diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoDateView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoDateView.m index b58e2497..97379165 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoDateView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoDateView.m @@ -90,7 +90,6 @@ } #pragma mark- UIPickerViewDelegate,UIPickerViewDataSource -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{ - return 3; } diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 4f40c96c..928c105b 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -1915,7 +1915,10 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 } //发送消息成功回调 - (void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error { - // 非本房间不处理 + if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]]) { + return; + } + NSString *publicChatRoomId = [NSString stringWithFormat:@"%@",[ClientConfig shareConfig].configInfo.publicChatRoomIdMap[self.userInfo.partitionId]]; if([message.session.sessionId isEqualToString:publicChatRoomId]){ // 非本房间不处理 @@ -1924,22 +1927,34 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 }else if(message.messageType == NIMMessageTypeImage){ [self.messageContainerView handleNIMImageMessage:message]; } - return;; - } - - 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:YMLocalizedString(@"XPRoomViewController10")]; - return; + id spamResExt = ((NSString *)spamRes[@"ext"]).toJSONObject; + NSDictionary *antispamDic = nil; + if ([spamResExt isKindOfClass:[NSArray class]]) { + antispamDic = [spamResExt xpSafeObjectAtIndex:0]; + } else if ([spamResExt isKindOfClass:[NSDictionary class]]) { + antispamDic = spamResExt[@"antispam"]; + } + NSDictionary *realAntiDic = nil; + if ([[antispamDic allKeys] containsObject:@"antispam"]) { + realAntiDic = antispamDic[@"antispam"];; + } else { + realAntiDic = antispamDic; + } + if (realAntiDic) { + NSInteger suggestion = [realAntiDic[@"suggestion"] integerValue]; + if (suggestion == 2) { + [self showErrorToast:YMLocalizedString(@"XPRoomViewController10")]; + return; + } } } - + if (error) return; if (message.messageType == NIMMessageTypeCustom) { NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;