房间PK修复了抱人上麦协议不对的问题
This commit is contained in:
@@ -352,6 +352,16 @@
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else if(attachment.first == CustomMessageType_Queue && attachment.second == Custom_Message_Sub_Queue_Invite) {
|
||||
ArrangeMicUserModel * userInfo = [ArrangeMicUserModel modelWithDictionary:attachment.data];
|
||||
if (userInfo.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
[self headerRefresh];
|
||||
}
|
||||
} else if(attachment.first == CustomMessageType_Room_PK && attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) {
|
||||
ArrangeMicUserModel * userInfo = [ArrangeMicUserModel modelWithDictionary:[attachment.data objectForKey:[AccountInfoStorage instance].getUid]];
|
||||
if (userInfo.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
[self headerRefresh];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(message.messageType == NIMMessageTypeNotification) {
|
||||
@@ -547,7 +557,25 @@
|
||||
position = [self findLockPosition];
|
||||
}
|
||||
NSString * uid = userInfo.uid;
|
||||
if (position.length > 0 && uid.length > 0) {
|
||||
if (position.length > 0) {
|
||||
if (self.userInfo.type == ArrangeMicType_Room_PK) {
|
||||
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
||||
[dic setValue:position forKey:@"position"];
|
||||
[dic setValue:uid forKey:@"uid"];
|
||||
[dic setValue:@(userInfo.groupType) forKey:@"groupType"];
|
||||
[dic setValue:userInfo.nick forKey:@"nick"];
|
||||
AttachmentModel * attachment = [[AttachmentModel alloc] init];
|
||||
attachment.first = CustomMessageType_Room_PK;
|
||||
attachment.second = Custom_Message_Sub_Room_PK_Manager_Up_Mic;
|
||||
attachment.data = @{uid:dic};
|
||||
NIMMessage *message = [[NIMMessage alloc]init];
|
||||
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||
object.attachment = attachment;
|
||||
message.messageObject = object;
|
||||
//构造会话
|
||||
NIMSession *session = [NIMSession session:self.userInfo.roomId type:NIMSessionTypeChatroom];
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||
} else {
|
||||
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
||||
[dic setValue:@(position.integerValue) forKey:@"micPosition"];
|
||||
[dic setValue:@(uid.integerValue) forKey:@"uid"];
|
||||
@@ -564,6 +592,10 @@
|
||||
NIMSession *session = [NIMSession session:self.userInfo.roomId type:NIMSessionTypeChatroom];
|
||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self headerRefresh];
|
||||
});
|
||||
} else {
|
||||
[self showErrorToast:@"麦上无空位了"];
|
||||
}
|
||||
|
@@ -258,7 +258,7 @@
|
||||
- (NSAttributedString *)createRoomPKAttribute:(AttachmentModel *)attachment {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
if (attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) {
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"管理员邀请" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"房主/管理员邀请" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
for (NSDictionary * selectuUser in [attachment.data allValues]) {
|
||||
RoomPKChooseUserModel * userInfoModel = [RoomPKChooseUserModel modelWithDictionary:selectuUser];
|
||||
if (userInfoModel.groupType != GroupType_default && userInfoModel.nick.length > 0) {
|
||||
|
@@ -201,10 +201,8 @@
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setIsManager:(BOOL)isManager {
|
||||
_isManager = isManager;
|
||||
if (_isManager) {
|
||||
self.beginButton.hidden = !_isManager;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setPkDetailInfo:(RoomPKDetailInfoModel *)pkDetailInfo {
|
||||
_pkDetailInfo = pkDetailInfo;
|
||||
|
@@ -880,6 +880,7 @@
|
||||
- (void)setIsManager:(BOOL)isManager {
|
||||
_isManager = isManager;
|
||||
self.beginButton.hidden = !_isManager;
|
||||
self.roomPKPlayingView.isManager = _isManager;
|
||||
}
|
||||
|
||||
- (void)setRedChooseArray:(NSArray<RoomPKChooseUserModel *> *)redChooseArray {
|
||||
|
Reference in New Issue
Block a user