Commit 957a14e1 authored by DanmeiChen's avatar DanmeiChen

fix delete messages

parent 4ea81a07
......@@ -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];
}];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment