相亲模式排麦如果退出房间或者被邀请上麦的话取消排麦
This commit is contained in:
@@ -334,25 +334,6 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if(attachment.first == CustomMessageType_Queue) {
|
||||
if (attachment.second == Custom_Message_Sub_Queue_Invite && self.arrangeMicInfo.myPos.integerValue > 0) {
|
||||
NSDictionary *dic = attachment.data;
|
||||
NSString *uid = dic[@"uid"];
|
||||
if (uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
if (self.userInfo.type == ArrangeMicType_Dating) {
|
||||
__block GroupType grouptype = GroupType_default;
|
||||
[self.arrangeMicInfo.queue enumerateObjectsUsingBlock:^(ArrangeMicUserModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
grouptype = obj.groupType;
|
||||
*stop = YES;
|
||||
}
|
||||
}];
|
||||
[self.presenter cancelRoomArrangeMic:self.userInfo.roomUid groupType:grouptype];
|
||||
} else {
|
||||
[self.presenter cancelRoomArrangeMic:self.userInfo.roomUid groupType:0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(message.messageType == NIMMessageTypeNotification) {
|
||||
|
@@ -19,12 +19,14 @@
|
||||
#import "XCHudTool.h"
|
||||
#import "XPRoomMiniManager.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "Api+ArrangeMic.h"
|
||||
///Model
|
||||
#import "RoomInfoModel.h"
|
||||
#import "MicroQueueModel.h"
|
||||
#import "MicroStateModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "AttachmentModel.h"
|
||||
#import "ArrangeMicModel.h"
|
||||
///View
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPNoteView.h"
|
||||
@@ -156,6 +158,31 @@
|
||||
rotationAnimation.removedOnCompletion = NO;
|
||||
[self.avatarImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
|
||||
}
|
||||
|
||||
- (void)cancelRoomArrangeMic {
|
||||
///退出排麦
|
||||
if (self.roomInfo.roomModeType == RoomModeType_Open_Micro_Mode || self.roomInfo.roomModeType == RoomModeType_Open_Blind) {
|
||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api getRoomArrangeMicList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
ArrangeMicModel * arrangeMicModel= [ArrangeMicModel modelWithJSON:data.data];
|
||||
if (arrangeMicModel.myPos.intValue > 0) {
|
||||
__block NSString * grouptype = @"0";
|
||||
if (self.roomInfo.roomModeType == RoomModeType_Open_Blind) {
|
||||
[arrangeMicModel.queue enumerateObjectsUsingBlock:^(ArrangeMicUserModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
grouptype = [NSString stringWithFormat:@"%ld", obj.groupType];
|
||||
*stop = YES;
|
||||
}
|
||||
}];
|
||||
}
|
||||
[Api cancelArrangeMic:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {} roomUid:roomUid operUid:uid groupType:grouptype];
|
||||
}
|
||||
}
|
||||
} roomUid:roomUid operUid:uid page:@"1" pageSize:@"50"];
|
||||
}
|
||||
}
|
||||
#pragma mark - NIMChatroomManagerDelegate
|
||||
- (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result {
|
||||
///如果不是最小化的是 没必要监听
|
||||
@@ -167,6 +194,7 @@
|
||||
}
|
||||
[[XPRoomMiniManager shareManager] configRoomInfo:nil];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self cancelRoomArrangeMic];
|
||||
[self hiddenRoomMiniView];
|
||||
}
|
||||
|
||||
@@ -312,6 +340,7 @@
|
||||
|
||||
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
||||
if (error) return;
|
||||
[self cancelRoomArrangeMic];
|
||||
[RtcManager instance].localMuted = YES;
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc] init];
|
||||
config.title = @"房主或管理员拉你上麦";
|
||||
|
@@ -265,7 +265,7 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
||||
}];
|
||||
|
||||
}
|
||||
[Api cancelArrangeMic:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {} roomUid:roomUid operUid:uid groupType:@"0"];
|
||||
[Api cancelArrangeMic:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {} roomUid:roomUid operUid:uid groupType:grouptype];
|
||||
}
|
||||
}
|
||||
} roomUid:roomUid operUid:uid page:@"1" pageSize:@"50"];
|
||||
@@ -430,6 +430,16 @@ UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
||||
case NIMChatroomEventTypeExit:
|
||||
onLineNumber -= 1;
|
||||
break;
|
||||
case NIMChatroomEventTypeQueueChange: // 麦序上下麦
|
||||
{
|
||||
NSDictionary* data = (NSDictionary *)content.ext;
|
||||
UserInfoModel* userInfo = [UserInfoModel modelWithJSON:[data objectForKey:NIMChatroomEventInfoQueueChangeItemValueKey]];
|
||||
NSInteger changeType = [data[NIMChatroomEventInfoQueueChangeTypeKey] integerValue];
|
||||
if (changeType == 1 && userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
[self cancelRoomArrangeMic];
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user