最小化状态的时候抱他下麦依然能说话
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#import "TTPopup.h"
|
#import "TTPopup.h"
|
||||||
#import "XCHudTool.h"
|
#import "XCHudTool.h"
|
||||||
#import "XPRoomMiniManager.h"
|
#import "XPRoomMiniManager.h"
|
||||||
|
#import "AccountInfoStorage.h"
|
||||||
///Model
|
///Model
|
||||||
#import "RoomInfoModel.h"
|
#import "RoomInfoModel.h"
|
||||||
#import "MicroQueueModel.h"
|
#import "MicroQueueModel.h"
|
||||||
@@ -156,6 +157,8 @@
|
|||||||
}
|
}
|
||||||
#pragma mark - NIMChatroomManagerDelegate
|
#pragma mark - NIMChatroomManagerDelegate
|
||||||
- (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result {
|
- (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result {
|
||||||
|
///如果不是最小化的是 没必要监听
|
||||||
|
if ([XPRoomMiniManager shareManager].getRoomInfo == nil) return;
|
||||||
if (result.reason == 2) {
|
if (result.reason == 2) {
|
||||||
[XCHUDTool showErrorWithMessage:@"您被管理员踢出直播间"];
|
[XCHUDTool showErrorWithMessage:@"您被管理员踢出直播间"];
|
||||||
} else if (result.reason == 5) {
|
} else if (result.reason == 5) {
|
||||||
@@ -167,6 +170,9 @@
|
|||||||
}
|
}
|
||||||
#pragma mark - NIMChatManagerDelegate
|
#pragma mark - NIMChatManagerDelegate
|
||||||
- (void)onRecvMessages:(NSArray<NIMMessage *> *)messages {
|
- (void)onRecvMessages:(NSArray<NIMMessage *> *)messages {
|
||||||
|
///如果不是最小化的是 没必要监听
|
||||||
|
if ([XPRoomMiniManager shareManager].getRoomInfo == nil) return;
|
||||||
|
|
||||||
for (NIMMessage * message in messages) {
|
for (NIMMessage * message in messages) {
|
||||||
// 非房间内消息不处理
|
// 非房间内消息不处理
|
||||||
if (message.session.sessionType != NIMSessionTypeChatroom) {
|
if (message.session.sessionType != NIMSessionTypeChatroom) {
|
||||||
@@ -181,23 +187,7 @@
|
|||||||
if (message.messageType == NIMMessageTypeNotification) {
|
if (message.messageType == NIMMessageTypeNotification) {
|
||||||
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
|
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
|
||||||
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
|
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
|
||||||
switch (content.eventType) {
|
[self handleNIMNotificationMessage:content];
|
||||||
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;
|
|
||||||
}
|
|
||||||
} else if (message.messageType == NIMMessageTypeCustom) {
|
} else if (message.messageType == NIMMessageTypeCustom) {
|
||||||
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
||||||
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
|
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
|
||||||
@@ -281,7 +271,7 @@
|
|||||||
BOOL selfNeedBroadcast = NO;
|
BOOL selfNeedBroadcast = NO;
|
||||||
for (int i = 0; i < self.micQueue.allKeys.count; i++) {
|
for (int i = 0; i < self.micQueue.allKeys.count; i++) {
|
||||||
MicroQueueModel * model = [self.micQueue objectForKey:[NSString stringWithFormat:@"%d", 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;
|
selfNeedBroadcast = model.microState.micState == MicroMicStateType_Open;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user