better sort of chat rooms

This commit is contained in:
Benjamin Reis 2018-02-13 14:17:21 +01:00
parent f85932b7f1
commit 78a1d45141
2 changed files with 9 additions and 8 deletions

View file

@ -96,9 +96,9 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
return -1;
}
if (last_new_event)
return 1;
return -1;
return -1;
return 1;
}
- (MSList *)sortChatRooms {

View file

@ -81,12 +81,13 @@
[_avatarImage setImage:[UIImage imageNamed:@"chat_group_avatar.png"] bordered:NO withRoundedRadius:YES];
}
LinphoneEventLog *last_event = (LinphoneEventLog *)linphone_chat_room_get_history_events(chatRoom, 1) ? linphone_chat_room_get_history_events(chatRoom, 1)->data : NULL;
if (last_event) {
_chatLatestTimeLabel.text =
[LinphoneUtils timeToString:linphone_event_log_get_creation_time(last_event) withFormat:LinphoneDateChatList];
_chatLatestTimeLabel.hidden = NO;
}
LinphoneEventLog *last_event = (LinphoneEventLog *)linphone_chat_room_get_history_events(chatRoom, 1)
? linphone_chat_room_get_history_events(chatRoom, 1)->data
: NULL;
_chatLatestTimeLabel.hidden = !last_event;
if (last_event)
_chatLatestTimeLabel.text = [LinphoneUtils timeToString:linphone_event_log_get_creation_time(last_event) withFormat:LinphoneDateChatList];
LinphoneChatMessage *last_msg = linphone_chat_room_get_last_message_in_history(chatRoom);
if (last_msg) {
NSString *message = [UIChatBubbleTextCell TextMessageForChat:last_msg];