mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
[chat] fix scroolToLastUnread message not take error and not delivered into account anymore
This commit is contained in:
parent
47dc82bb16
commit
d484c01845
1 changed files with 6 additions and 3 deletions
|
|
@ -113,15 +113,18 @@
|
|||
if (messageList == nil || _chatRoom == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
int index = -1;
|
||||
size_t count = bctbx_list_size(messageList);
|
||||
// Find first unread & set all entry read
|
||||
for (int i = 0; i < count; ++i) {
|
||||
int read = linphone_chat_message_is_read(bctbx_list_nth_data(messageList, i));
|
||||
if (read == 0) {
|
||||
if (index == -1)
|
||||
LinphoneChatMessageState state = linphone_chat_message_get_state(bctbx_list_nth_data(messageList, i));
|
||||
if (read == 0 &&
|
||||
!(state == LinphoneChatMessageStateFileTransferError || state == LinphoneChatMessageStateNotDelivered)) {
|
||||
if (index == -1) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (index == -1 && count > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue