最小化状态的时候抱他下麦依然能说话

This commit is contained in:
fengshuo
2021-12-11 15:00:12 +08:00
parent c11cd51943
commit a234677810

View File

@@ -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;
}
}