From 3192483923979e3c979c079fac822249fc36f491 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 4 Jun 2018 13:29:03 +0200 Subject: [PATCH] fix 1-1 mark as read --- Classes/ChatConversationTableView.m | 3 +-- Classes/ChatConversationView.m | 3 +-- Classes/ChatsListTableView.m | 6 ------ Classes/LinphoneAppDelegate.m | 6 +++--- submodules/linphone | 2 +- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index 477546bb1..e53b3227d 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -138,9 +138,8 @@ if (index == -1 && count > 0) index = (int)count - 1; - if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) { + if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) [ChatConversationView markAsRead:_chatRoom]; - } // Scroll to unread if (index < 0) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 3ebf23743..60fccdfd9 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -208,9 +208,8 @@ static UICompositeViewDescription *compositeDescription = nil; } - (void)applicationWillEnterForeground:(NSNotification *)notif { - if (_chatRoom != nil) { + if (_chatRoom) [ChatConversationView markAsRead:_chatRoom]; - } } - (void)callUpdateEvent:(NSNotification *)notif { diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index 89cfefe65..49e3b98d7 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -163,12 +163,6 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(_data, (int)[indexPath row]); [PhoneMainView.instance goToChatRoom:chatRoom]; - - // on iPad, force unread bubble to disappear by reloading the cell - if (IPAD) { - UIChatCell *cell = (UIChatCell *)[tableView cellForRowAtIndexPath:indexPath]; - [cell updateUnreadBadge]; - } } void deletion_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) { diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index e8430ef3b..31b1f027b 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -555,9 +555,9 @@ didInvalidatePushTokenForType:(NSString *)type { LinphoneAddress *peer = linphone_address_new(peer_address.UTF8String); LinphoneAddress *local = linphone_address_new(local_address.UTF8String); LinphoneChatRoom *room = linphone_core_find_chat_room(LC, peer, local); - if (room) { + if (room) [ChatConversationView markAsRead:room]; - } + linphone_address_unref(peer); linphone_address_unref(local); } else if ([response.actionIdentifier isEqual:@"Cancel"]) { @@ -713,7 +713,7 @@ didInvalidatePushTokenForType:(NSString *)type { LinphoneAddress *peer = linphone_address_new(peer_address.UTF8String); LinphoneAddress *local = linphone_address_new(local_address.UTF8String); LinphoneChatRoom *room = linphone_core_find_chat_room(LC, peer, local); - if (room && [UIApplication sharedApplication].applicationState == UIApplicationStateActive) + if (room) [ChatConversationView markAsRead:room]; linphone_address_unref(peer); diff --git a/submodules/linphone b/submodules/linphone index d3029aa97..e9a88353a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit d3029aa97052115c9c3e0e66c9c56fb335665443 +Subproject commit e9a88353a0eb7c99647aeea8c4630aaa50cf4cf9