diff --git a/xplan-ios/Main/Room/View/ArrangeMic/View/XPArrangeMicViewController.m b/xplan-ios/Main/Room/View/ArrangeMic/View/XPArrangeMicViewController.m index a466eaab..0460d6dd 100644 --- a/xplan-ios/Main/Room/View/ArrangeMic/View/XPArrangeMicViewController.m +++ b/xplan-ios/Main/Room/View/ArrangeMic/View/XPArrangeMicViewController.m @@ -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,24 +557,46 @@ position = [self findLockPosition]; } NSString * uid = userInfo.uid; - if (position.length > 0 && uid.length > 0) { - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic setValue:@(position.integerValue) forKey:@"micPosition"]; - [dic setValue:@(uid.integerValue) forKey:@"uid"]; - AttachmentModel *attachement = [[AttachmentModel alloc]init]; - attachement.first = CustomMessageType_Queue; - attachement.second = Custom_Message_Sub_Queue_Invite; - attachement.data = dic; - - NIMMessage *message = [[NIMMessage alloc]init]; - NIMCustomObject *object = [[NIMCustomObject alloc] init]; - object.attachment = attachement; - message.messageObject = object; - //构造会话 - NIMSession *session = [NIMSession session:self.userInfo.roomId type:NIMSessionTypeChatroom]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; - [self dismissViewControllerAnimated:YES completion:nil]; - } else { + 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"]; + AttachmentModel *attachement = [[AttachmentModel alloc]init]; + attachement.first = CustomMessageType_Queue; + attachement.second = Custom_Message_Sub_Queue_Invite; + attachement.data = dic; + + NIMMessage *message = [[NIMMessage alloc]init]; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachement; + message.messageObject = object; + //构造会话 + 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:@"麦上无空位了"]; } } diff --git a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m index 2cba0136..1809535f 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -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) { diff --git a/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKPlayingView.m b/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKPlayingView.m index 7f66693e..097115be 100644 --- a/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKPlayingView.m +++ b/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKPlayingView.m @@ -201,9 +201,7 @@ #pragma mark - Getters And Setters - (void)setIsManager:(BOOL)isManager { _isManager = isManager; - if (_isManager) { - self.beginButton.hidden = !_isManager; - } + self.beginButton.hidden = !_isManager; } - (void)setPkDetailInfo:(RoomPKDetailInfoModel *)pkDetailInfo { diff --git a/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKProgressView.m b/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKProgressView.m index 456f03e0..22efde1c 100644 --- a/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKProgressView.m +++ b/xplan-ios/Main/Room/View/RoomPK/View/XPRoomPKProgressView.m @@ -880,6 +880,7 @@ - (void)setIsManager:(BOOL)isManager { _isManager = isManager; self.beginButton.hidden = !_isManager; + self.roomPKPlayingView.isManager = _isManager; } - (void)setRedChooseArray:(NSArray *)redChooseArray {