修复个播房非离开模式下礼物面板没有房主

This commit is contained in:
chenguilong
2022-03-10 11:50:54 +08:00
parent 912c5b2184
commit 1923978f38
3 changed files with 37 additions and 3 deletions

View File

@@ -205,4 +205,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 8120dbc8eb506e124ccb97e8ce2ecf2420ac8b5f PODFILE CHECKSUM: 8120dbc8eb506e124ccb97e8ce2ecf2420ac8b5f
COCOAPODS: 1.11.0 COCOAPODS: 1.11.2

View File

@@ -191,7 +191,23 @@
userModel.position = @"-1"; userModel.position = @"-1";
userModel.uid = roomInfo.uid; userModel.uid = roomInfo.uid;
[array addObject:userModel]; [array addObject:userModel];
} } else if (self.delegate.getRoomInfo.type == RoomType_Anchor) {
RoomInfoModel * roomInfo= self.delegate.getRoomInfo;
BOOL hadContainerOwner = NO;
for (UserInfoModel *userModel in array) {
if (userModel.uid == roomInfo.uid) {
hadContainerOwner = YES;
break;
}
}
if (!hadContainerOwner) {
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = roomInfo.avatar;
userModel.position = @"-1";
userModel.uid = roomInfo.uid;
[array addObject:userModel];
}
}
return array; return array;
} }

View File

@@ -416,7 +416,25 @@
userModel.isSelect = YES; userModel.isSelect = YES;
} }
[array addObject:userModel]; [array addObject:userModel];
} } else if (roomInfo.type == RoomType_Anchor) {
BOOL hadContainerOwner = NO;
for (UserInfoModel *userModel in array) {
if (userModel.uid == roomInfo.uid) {
hadContainerOwner = YES;
break;
}
}
if (!hadContainerOwner) {
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = roomInfo.avatar;
userModel.position = @"-1";
userModel.uid = self.cardInfo.uid.integerValue;
if (roomInfo.uid == self.cardInfo.uid.integerValue) {
userModel.isSelect = YES;
}
[array addObject:userModel];
}
}
return array; return array;
} }