mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
better sort of chat rooms
This commit is contained in:
parent
f85932b7f1
commit
78a1d45141
2 changed files with 9 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue