do not update 4 time the same thing

This commit is contained in:
Benjamin Reis 2018-02-15 15:58:41 +01:00
parent 84efeb893e
commit 811c2f1068
3 changed files with 4 additions and 7 deletions

View file

@ -109,7 +109,7 @@ static UICompositeViewDescription *compositeDescription = nil;
name:kLinphoneCallUpdate
object:nil];
if (_chatRoom)
[self setChatRoom:_chatRoom];
[self setRoom:_chatRoom];
}
- (void)viewWillDisappear:(BOOL)animated {
@ -150,7 +150,7 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark -
- (void)setChatRoom:(LinphoneChatRoom *)chatRoom {
- (void)setRoom:(LinphoneChatRoom *)chatRoom {
_chatRoom = chatRoom;
LinphoneChatRoomCbs *cbs = linphone_chat_room_get_callbacks(_chatRoom);
linphone_chat_room_cbs_set_state_changed(cbs, on_chat_room_state_changed);
@ -197,9 +197,6 @@ static UICompositeViewDescription *compositeDescription = nil;
[self update];
linphone_chat_room_mark_as_read(_chatRoom);
[self setComposingVisible:linphone_chat_room_is_remote_composing(_chatRoom) withDelay:0];
TabBarView *tab = (TabBarView *)[PhoneMainView.instance.mainViewController
getCachedController:NSStringFromClass(TabBarView.class)];
[tab update:YES];
[PhoneMainView.instance updateApplicationBadgeNumber];
} else {
_chatView.hidden = YES;

View file

@ -164,7 +164,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
if (![self isEditing]) {
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(data, (int)[indexPath row]);
ChatConversationView *view = VIEW(ChatConversationView);
[view setChatRoom:chatRoom];
view.chatRoom = chatRoom;
// on iPad, force unread bubble to disappear by reloading the cell
if (IPAD) {
UIChatCell *cell = (UIChatCell *)[tableView cellForRowAtIndexPath:indexPath];

View file

@ -871,7 +871,7 @@ static RootViewManager *rootViewManagerInstance = nil;
return;
}
ChatConversationView *view = VIEW(ChatConversationView);
[view setChatRoom:room];
view.chatRoom = room;
[self changeCurrentView:view.compositeViewDescription];
}