mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix chatconversationview when open push notifications
This commit is contained in:
parent
5ad93ec6f4
commit
cb38cc3b93
3 changed files with 8 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue