diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index 4de6666e5..a981f3b13 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -318,9 +318,9 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f; LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue]; linphone_event_log_delete_from_database(event); [eventList removeObjectAtIndex:indexPath.row]; - NSInteger index = indexPath.row + _currentIndex; + NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count); if (index < totalEventList.count) - [totalEventList removeObject:[NSNumber numberWithInteger:index]]; + [totalEventList removeObjectAtIndex:index]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom]; @@ -366,9 +366,9 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f; LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue]; linphone_event_log_delete_from_database(event); [eventList removeObjectAtIndex:indexPath.row]; - NSInteger index = indexPath.row + _currentIndex; + NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count); if (index < totalEventList.count) - [totalEventList removeObject:[NSNumber numberWithInteger:index]]; + [totalEventList removeObjectAtIndex:index]; }]; }