风险提醒优化

This commit is contained in:
fengshuo
2022-08-15 18:53:17 +08:00
parent d2bbdc7e65
commit 367aee0b53
7 changed files with 55 additions and 9 deletions

View File

@@ -1165,6 +1165,16 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]) {
return;
}
if (message.yidunAntiSpamRes) {
NSDictionary * spamRes = message.yidunAntiSpamRes.toJSONObject;
NSDictionary * spamResExt = ((NSString *)spamRes[@"ext"]).toJSONObject;
if ([spamResExt[@"antispam"][@"suggestion"] intValue] == 2) {
[self showErrorToast:@"消息中可能含有违规信息,请停止发送类似信息!"];
return;
}
}
if (error) return;
if (message.messageType == NIMMessageTypeCustom) {
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;