From ae94c10763aa71abc4198853a2c0deef6181ba9d Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 15 Feb 2018 10:41:37 +0100 Subject: [PATCH] add display name to last message display --- Classes/LinphoneUI/UIChatCell.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index be0f0da0e..2f7bc371d 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -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);