From d484c018459ea214d5a840428861d089ee8f82ce Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Fri, 14 Apr 2017 12:05:25 +0200 Subject: [PATCH] [chat] fix scroolToLastUnread message not take error and not delivered into account anymore --- Classes/ChatConversationTableView.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index ba958810d..c13f906e9 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -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) {