From d7b27d7b7fd646d0eda0719549740618b0437b2b Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Fri, 21 Dec 2018 16:01:22 +0100 Subject: [PATCH] fix refresh deleted messages --- Classes/ChatConversationTableView.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index 322af9273..babff47e6 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -316,6 +316,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; + if (index < totalEventList.count) + [totalEventList removeObject:[NSNumber numberWithInteger:index]]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationBottom]; @@ -360,6 +363,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; + if (index < totalEventList.count) + [totalEventList removeObject:[NSNumber numberWithInteger:index]]; }]; }