From 7968c65055310703b60f3644f96c2a987449a94a Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Mon, 26 Jul 2021 09:50:16 +0200 Subject: [PATCH] Fix Chat bubble size with only text, or text with single attcht --- Classes/LinphoneUI/UIChatBubbleTextCell.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index 972398ee1..c5a9f2cf1 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -624,13 +624,14 @@ static const CGFloat CELL_MESSAGE_Y_MARGIN = 44; } - LinphoneContent *fileContent = linphone_chat_message_get_file_transfer_information(chat); - if (url == nil && (fileContent == NULL||fileContent == voiceContent)) { + // if here, either 1 file + text or just one file or just text. + BOOL justText = linphone_chat_message_get_text_content(chat) != NULL && contentCount == 1; + if (justText) { // Just text size = [self computeBoundingBox:messageText size:CGSizeMake(width - CELL_MESSAGE_X_MARGIN - 4, CGFLOAT_MAX) font:messageFont]; } else { - + LinphoneContent *fileContent = linphone_chat_message_get_file_transfer_information(chat); NSString *localImage = [LinphoneManager getMessageAppDataForKey:@"localimage" inMessage:chat]; NSString *localFile = [LinphoneManager getMessageAppDataForKey:@"localfile" inMessage:chat]; NSString *localVideo = [LinphoneManager getMessageAppDataForKey:@"localvideo" inMessage:chat];