fix 1-1 mark as read

This commit is contained in:
Benjamin Reis 2018-06-04 13:29:03 +02:00
parent 4b31919ab3
commit 3192483923
5 changed files with 6 additions and 14 deletions

View file

@ -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)

View file

@ -208,9 +208,8 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)applicationWillEnterForeground:(NSNotification *)notif {
if (_chatRoom != nil) {
if (_chatRoom)
[ChatConversationView markAsRead:_chatRoom];
}
}
- (void)callUpdateEvent:(NSNotification *)notif {

View file

@ -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) {

View file

@ -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);

@ -1 +1 @@
Subproject commit d3029aa97052115c9c3e0e66c9c56fb335665443
Subproject commit e9a88353a0eb7c99647aeea8c4630aaa50cf4cf9