From a234677810f6cde6f29febef1b4f05b2f7b068c8 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Sat, 11 Dec 2021 15:00:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=8C=96=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=8A=B1=E4=BB=96=E4=B8=8B=E9=BA=A6?= =?UTF-8?q?=E4=BE=9D=E7=84=B6=E8=83=BD=E8=AF=B4=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios/Main/Room/View/XPMiniRoomView.m | 26 +++++++---------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/xplan-ios/Main/Room/View/XPMiniRoomView.m b/xplan-ios/Main/Room/View/XPMiniRoomView.m index b3cb5d4e..4d0535b5 100644 --- a/xplan-ios/Main/Room/View/XPMiniRoomView.m +++ b/xplan-ios/Main/Room/View/XPMiniRoomView.m @@ -18,6 +18,7 @@ #import "TTPopup.h" #import "XCHudTool.h" #import "XPRoomMiniManager.h" +#import "AccountInfoStorage.h" ///Model #import "RoomInfoModel.h" #import "MicroQueueModel.h" @@ -156,6 +157,8 @@ } #pragma mark - NIMChatroomManagerDelegate - (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result { + ///如果不是最小化的是 没必要监听 + if ([XPRoomMiniManager shareManager].getRoomInfo == nil) return; if (result.reason == 2) { [XCHUDTool showErrorWithMessage:@"您被管理员踢出直播间"]; } else if (result.reason == 5) { @@ -167,6 +170,9 @@ } #pragma mark - NIMChatManagerDelegate - (void)onRecvMessages:(NSArray *)messages { + ///如果不是最小化的是 没必要监听 + if ([XPRoomMiniManager shareManager].getRoomInfo == nil) return; + for (NIMMessage * message in messages) { // 非房间内消息不处理 if (message.session.sessionType != NIMSessionTypeChatroom) { @@ -181,23 +187,7 @@ if (message.messageType == NIMMessageTypeNotification) { NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject; NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content; - switch (content.eventType) { - case NIMChatroomEventTypeInfoUpdated: // 麦序状态更新 - { - NSDictionary *data = [content.notifyExt toJSONObject]; - int type = [data[@"type"] intValue]; - switch (type) { - case 1: - break; - case 2: - case 3: - [self handleNIMNotificationMessage:content]; - break; - } - } - default: - break; - } + [self handleNIMNotificationMessage:content]; } else if (message.messageType == NIMMessageTypeCustom) { NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { @@ -281,7 +271,7 @@ BOOL selfNeedBroadcast = NO; for (int i = 0; i < self.micQueue.allKeys.count; i++) { MicroQueueModel * model = [self.micQueue objectForKey:[NSString stringWithFormat:@"%d", i]]; - if (self.userInfo.uid && model.userInfo.uid == self.userInfo.uid) { + if (model.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { selfNeedBroadcast = model.microState.micState == MicroMicStateType_Open; } }