Commit cb38cc3b authored by DanmeiChen's avatar DanmeiChen

fix chatconversationview when open push notifications

parent 5ad93ec6
......@@ -39,7 +39,6 @@
@private
NSMutableArray *eventList;
NSMutableArray *totalEventList;
BOOL preLoad;
}
@property(nonatomic) LinphoneChatRoom *chatRoom;
......
......@@ -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);
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment