diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index f692d0e46..30ea5ea0a 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -104,9 +104,9 @@ } - (void)scrollToLastUnread:(BOOL)animated { - if (eventList == nil || _chatRoom == nil) { + if (eventList == nil || _chatRoom == nil) return; - } + int index = -1; size_t count = bctbx_list_size(eventList); // Find first unread & set all entry read diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 423e28eb3..c853b634e 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -761,9 +761,6 @@ void on_chat_room_chat_message_received(LinphoneChatRoom *cr, const LinphoneEven if (!chat) return; - if (linphone_chat_message_is_outgoing(chat)) - return; - const LinphoneAddress *from = linphone_chat_message_get_from_address(chat); if (!from) return; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index d0952fb02..ad2ee63e3 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1112,9 +1112,6 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAut pushBgTaskMsg = 0; } - if (linphone_chat_message_is_outgoing(msg)) - return; - if (!linphone_chat_message_is_file_transfer(msg) && !linphone_chat_message_is_text(msg)) return; @@ -1128,6 +1125,9 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAut [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self userInfo:dict]; + if (linphone_chat_message_is_outgoing(msg)) + return; + if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) return; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 51d4045cc..58ffc2ef5 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -287,9 +287,11 @@ static RootViewManager *rootViewManagerInstance = nil; LinphoneChatMessage *msg = [[notif.userInfo objectForKey:@"message"] pointerValue]; NSString *callID = [notif.userInfo objectForKey:@"call-id"]; [self updateApplicationBadgeNumber]; - LinphoneChatRoom *room = msg ? linphone_chat_message_get_chat_room(msg) : NULL; - if (!room) + if (!msg) + return; + + if (linphone_chat_message_is_outgoing(msg)) return; ChatConversationView *view = VIEW(ChatConversationView);