mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix delete chat cells
This commit is contained in:
parent
19ab701f63
commit
202e33a736
1 changed files with 5 additions and 4 deletions
|
|
@ -40,6 +40,7 @@
|
|||
[super viewWillAppear:animated];
|
||||
self.tableView.accessibilityIdentifier = @"ChatRoom list";
|
||||
_imagesInChatroom = [NSMutableDictionary dictionary];
|
||||
_currentIndex = 0;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
@ -317,10 +318,10 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f;
|
|||
[tableView beginUpdates];
|
||||
LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue];
|
||||
linphone_event_log_delete_from_database(event);
|
||||
NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count);
|
||||
if (index < totalEventList.count)
|
||||
[totalEventList removeObjectAtIndex:index];
|
||||
[eventList removeObjectAtIndex:indexPath.row];
|
||||
NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count);
|
||||
if (index < totalEventList.count)
|
||||
[totalEventList removeObjectAtIndex:index];
|
||||
|
||||
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
|
||||
withRowAnimation:UITableViewRowAnimationBottom];
|
||||
|
|
@ -365,10 +366,10 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f;
|
|||
[super removeSelectionUsing:^(NSIndexPath *indexPath) {
|
||||
LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue];
|
||||
linphone_event_log_delete_from_database(event);
|
||||
[eventList removeObjectAtIndex:indexPath.row];
|
||||
NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count);
|
||||
if (index < totalEventList.count)
|
||||
[totalEventList removeObjectAtIndex:index];
|
||||
[eventList removeObjectAtIndex:indexPath.row];
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue