From a8cd49c7413e4d0b31041ef15c098ef523af8110 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Fri, 25 Sep 2020 14:53:37 +0200 Subject: [PATCH] fix workaround: can not delete image --- Classes/ChatConversationTableView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/ChatConversationTableView.m b/Classes/ChatConversationTableView.m index c73421736..f72d9acc5 100644 --- a/Classes/ChatConversationTableView.m +++ b/Classes/ChatConversationTableView.m @@ -313,7 +313,9 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f; - (void) tableView:(UITableView *)tableView deleteRowAtIndex:(NSIndexPath *)indexPath { [tableView beginUpdates]; LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue]; - linphone_event_log_delete_from_database(event); + // TODO: fix workaround + //linphone_event_log_delete_from_database(event); + linphone_chat_room_delete_message(_chatRoom, linphone_event_log_get_chat_message(event)); NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count); if (index < totalEventList.count) [totalEventList removeObjectAtIndex:index]; @@ -361,7 +363,9 @@ static const CGFloat MESSAGE_SPACING_PERCENTAGE = 1.f; - (void)removeSelectionUsing:(void (^)(NSIndexPath *))remover { [super removeSelectionUsing:^(NSIndexPath *indexPath) { LinphoneEventLog *event = [[eventList objectAtIndex:indexPath.row] pointerValue]; - linphone_event_log_delete_from_database(event); + // TODO: fix workaround + //linphone_event_log_delete_from_database(event); + linphone_chat_room_delete_message(_chatRoom, linphone_event_log_get_chat_message(event)); NSInteger index = indexPath.row + _currentIndex + (totalEventList.count - eventList.count); if (index < totalEventList.count) [totalEventList removeObjectAtIndex:index];