最小化状态的时候抱他下麦依然能说话
This commit is contained in:
@@ -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<NIMMessage *> *)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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user