diff --git a/Classes/ChatConversationTableView.h b/Classes/ChatConversationTableView.h index dc0e4c574..b603ab3f4 100644 --- a/Classes/ChatConversationTableView.h +++ b/Classes/ChatConversationTableView.h @@ -39,7 +39,6 @@ @private NSMutableArray *eventList; NSMutableArray *totalEventList; - BOOL preLoad; } @property(nonatomic) LinphoneChatRoom *chatRoom; diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index 7d9c184cb..fc2b4799d 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -45,11 +45,12 @@ #pragma mark - - (void)clearEventList { - for (NSValue *value in eventList) { + for (NSValue *value in totalEventList) { LinphoneEventLog *event = value.pointerValue; linphone_event_log_unref(event); } [eventList removeAllObjects]; + [totalEventList removeAllObjects]; } - (void)updateData { @@ -105,14 +106,13 @@ - (void)reloadData { [self updateData]; - preLoad = TRUE; [self.tableView reloadData]; - preLoad = FALSE; [self scrollToLastUnread:false]; } - (void)addEventEntry:(LinphoneEventLog *)event { [eventList addObject:[NSValue valueWithPointer:linphone_event_log_ref(event)]]; + [totalEventList addObject:[NSValue valueWithPointer:linphone_event_log_ref(event)]]; int pos = (int)eventList.count - 1; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:pos inSection:0]; [self.tableView beginUpdates]; @@ -297,9 +297,6 @@ static const int BASIC_EVENT_LIST=15; static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f; - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - // pre-download data - if (preLoad) - return 60; LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue]; if (linphone_event_log_get_type(event) == LinphoneEventLogTypeConferenceChatMessage) { LinphoneChatMessage *chat = linphone_event_log_get_chat_message(event); diff --git a/Classes/Utils/FileTransferDelegate.m b/Classes/Utils/FileTransferDelegate.m index 715a89710..8f197c324 100644 --- a/Classes/Utils/FileTransferDelegate.m +++ b/Classes/Utils/FileTransferDelegate.m @@ -237,6 +237,11 @@ static LinphoneBuffer *linphone_iphone_file_transfer_send(LinphoneChatMessage *m linphone_chat_message_cbs_set_file_transfer_send(linphone_chat_message_get_callbacks(thiz.message), NULL); thiz.message = NULL; [thiz stopAndDestroy]; + //workaround fix : avoid chatconversationtableview scrolling + [NSNotificationCenter.defaultCenter postNotificationName:kLinphoneFileTransferSendUpdate + object:thiz + userInfo:@{@"state" : @(LinphoneChatMessageStateDelivered), + }]; } return buffer; } else {