修复了删除最近回话删除聊天记录的问题

This commit is contained in:
fengshuo
2022-12-16 18:26:53 +08:00
parent f1ae4a4a39
commit b835259531

View File

@@ -239,7 +239,9 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction * deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"置顶" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NIMRecentSession * session = [self.recentSessions safeObjectAtIndex1:indexPath.row];
[[NIMSDK sharedSDK].conversationManager deleteRecentSession:session];
NIMDeleteMessagesOption * opt = [[NIMDeleteMessagesOption alloc] init];
opt.removeSession = YES;
[[NIMSDK sharedSDK].conversationManager deleteAllmessagesInSession:session.session option:opt];
}];
deleteAction.title = @"删除";
deleteAction.backgroundColor = [UIColor redColor];