From ebe3c0133b4e1b7eefa002b0a91e4570086f0202 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Wed, 9 Jan 2019 10:04:06 +0100 Subject: [PATCH] fix chat size --- Classes/ChatConversationTableView.m | 2 +- Classes/LinphoneUI/UIChatBubbleTextCell.m | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index 97d28418e..7d9c184cb 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -191,7 +191,7 @@ } static const int MAX_AGGLOMERATED_TIME=300; -static const int BASIC_EVENT_LIST=20; +static const int BASIC_EVENT_LIST=15; - (BOOL)isFirstIndexInTableView:(NSIndexPath *)indexPath chat:(LinphoneChatMessage *)chat { LinphoneEventLog *previousEvent = nil; diff --git a/Classes/LinphoneUI/UIChatBubbleTextCell.m b/Classes/LinphoneUI/UIChatBubbleTextCell.m index 4290bbc70..f96b94db6 100644 --- a/Classes/LinphoneUI/UIChatBubbleTextCell.m +++ b/Classes/LinphoneUI/UIChatBubbleTextCell.m @@ -420,13 +420,6 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100; } + (CGSize)ViewHeightForMessageText:(LinphoneChatMessage *)chat withWidth:(int)width textForImdn:(NSString *)imdnText{ - - // Avoid calculating the size each time, it takes too much time. Update the size of the chat cell once the version of the application has been modified. - NSString *chatSize = [LinphoneManager getMessageAppDataForKey:@"newChatSize" inMessage:chat]; - NSString *version = [NSString stringWithFormat:@"%@-%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]; - if (chatSize && !imdnText && [version isEqualToString:[LinphoneManager getMessageAppDataForKey:@"appVersion" inMessage:chat]]) - return CGSizeFromString(chatSize); - NSString *messageText = [UIChatBubbleTextCell TextMessageForChat:chat]; static UIFont *messageFont = nil; @@ -510,9 +503,6 @@ static const CGFloat CELL_IMAGE_X_MARGIN = 100; size.width = MAX(size.width + CELL_MESSAGE_X_MARGIN, CELL_MIN_WIDTH); size.height = MAX(size.height + CELL_MESSAGE_Y_MARGIN, CELL_MIN_HEIGHT); - - [LinphoneManager setValueInMessageAppData:NSStringFromCGSize(size) forKey:@"newChatSize" inMessage:chat]; - [LinphoneManager setValueInMessageAppData:version forKey:@"appVersion" inMessage:chat]; return size; }