烦死了😡

This commit is contained in:
zu
2021-12-01 17:56:10 +08:00
parent 026f96b561
commit e4e344de6c

View File

@@ -19,7 +19,6 @@
#import "TTPopup.h"
#import "XPMacro.h"
#import "XPGiftStorage.h"
#import "AccountInfoStorage.h"
#import "XCHudTool.h"
///Model
#import "AttachmentModel.h"
@@ -265,7 +264,7 @@
[self receiveGift:attachment];
} else if(attachment.first == CustomMessageType_Queue && attachment.second == Custom_Message_Sub_Queue_Invite) {
NSDictionary * dic = attachment.data;
if (((NSString *)dic[@"uid"]).integerValue == [AccountInfoStorage instance].getUid.integerValue) {
if (((NSString *)dic[@"uid"]).integerValue == self.hostDelegate.getUserInfo.uid) {
[self microInvite:dic[@"micPosition"]];
}
}
@@ -316,32 +315,13 @@
}];
}
#pragma mark -
- (RACSignal *)rac_queryChatRoomMember:(NSString *)uid roomId:(NSString *)roomId{
return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = roomId;
request.userIds = @[uid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
[subscriber sendNext:members.firstObject];
[subscriber sendCompleted];
}else {
[subscriber sendNext:nil];
[subscriber sendCompleted];
}
}];
return nil;
}];
}
#pragma mark - StageViewDelegate - View
- (void)didSelectAtIndex:(NSInteger)index {
NSString * uid = [AccountInfoStorage instance].getUid;
MicroQueueModel* micModel = [self.micQueue objectForKey:[self indexToPosition:index]];
UserInfoModel* userInfo = self.hostDelegate.getUserInfo;
RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo;
NSString* position = [self indexToPosition:index];
NSString * uid = [NSString stringWithFormat:@"%ld", userInfo.uid];
NSString* roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
void(^nimUpQueue)(NSString*) = ^ (NSString* up){
@@ -371,8 +351,6 @@
}
}];
};
TTActionSheetConfig *upMic = [TTActionSheetConfig normalTitle:@"上麦" clickAction:^{
NSString* selfUid = [NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getUserInfo.uid];
@@ -383,39 +361,41 @@
nimUpQueue(position);
}
}];
NSString * lockTitle = micModel.microState.posState == MicroPosStateType_Free ? @"锁麦" : @"解锁";
TTActionSheetConfig *lockMic = [TTActionSheetConfig normalTitle:lockTitle clickAction:^{
///TODO ;
// TODO:
}];
NSString * muteTitle = micModel.microState.micState == MicroMicStateType_Open ? @"闭麦" : @"开麦";
TTActionSheetConfig *muteMic = [TTActionSheetConfig normalTitle:muteTitle clickAction:^{
///TODO ;
// TODO:
}];
if (micModel.userInfo && micModel.userInfo.uid > 0) {///
NSString * targetUid = [NSString stringWithFormat:@"%ld", micModel.userInfo.uid];
XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init];
model.uid = targetUid;
model.position = position;
model.posState = (UserCardMicroPosStateType)micModel.microState.posState;
model.micState = (UserCardMicroMicStateType)micModel.microState.micState;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model delegate:self.hostDelegate];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
} else {/// ///()
[[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) {
NIMChatroomMember * member = x;
if (member == nil) {return;}
if (member.type == NIMTeamMemberTypeOwner || member.type == NIMTeamMemberTypeManager) {///
[TTPopup actionSheetWithItems:@[upMic, lockMic, muteMic]];
} else {///
if (micModel.microState.posState == MicroPosStateType_Lock) {return;}
nimUpQueue(position);
}
}];
}
if (micModel.userInfo && micModel.userInfo.uid > 0) {
NSString * targetUid = [NSString stringWithFormat:@"%ld", micModel.userInfo.uid];
XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init];
model.uid = targetUid;
model.position = position;
model.posState = (UserCardMicroPosStateType)micModel.microState.posState;
model.micState = (UserCardMicroMicStateType)micModel.microState.micState;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model delegate:self.hostDelegate];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
} else {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = roomId;
request.userIds = @[uid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
NIMChatroomMember * member = members.firstObject;
if (member == nil) {return;}
if (member.type == NIMTeamMemberTypeOwner || member.type == NIMTeamMemberTypeManager) {///
[TTPopup actionSheetWithItems:@[upMic, lockMic, muteMic]];
} else {
if (micModel.microState.posState == MicroPosStateType_Lock) return;
nimUpQueue(position);
}
}];
}
}
- (NSInteger)countOfMircoView {