add display name to last message display

This commit is contained in:
Benjamin Reis 2018-02-15 10:41:37 +01:00
parent ab8d017904
commit ae94c10763

View file

@ -85,12 +85,13 @@
LinphoneChatMessage *last_msg = linphone_chat_room_get_last_message_in_history(chatRoom);
if (last_msg) {
NSString *message = [UIChatBubbleTextCell TextMessageForChat:last_msg];
NSString *text = [[FastAddressBook displayNameForAddress:linphone_chat_message_get_from_address(last_msg)]
stringByAppendingFormat:@" : %@", [UIChatBubbleTextCell TextMessageForChat:last_msg]];
// shorten long messages
if ([message length] > 50) {
message = [[message substringToIndex:50] stringByAppendingString:@"[...]"];
if ([text length] > 50) {
text = [[text substringToIndex:50] stringByAppendingString:@"[...]"];
}
_chatContentLabel.text = message;
_chatContentLabel.text = text;
} else {
_chatContentLabel.text = nil;
_chatLatestTimeLabel.text = NSLocalizedString(@"Now", nil);