同时在线用户排除房主
This commit is contained in:
parent
75b1fb5dc6
commit
1f5717f090
@ -126,7 +126,14 @@ public class UserHeartbeatListener implements MessageListener {
|
||||
// 房间内同时在线用户数
|
||||
if (Objects.equals(roomProfile.getUserId(), event.getUserId())) {
|
||||
List<LiveRoomUser> liveRoomUsers = liveMicUserCacheService.listUser(roomProfile.getId());
|
||||
Set<Long> userIdList = liveRoomUsers.stream().map(LiveRoomUser::getUserId).collect(Collectors.toSet());
|
||||
Set<Long> userIdList = liveRoomUsers.stream()
|
||||
.map(LiveRoomUser::getUserId)
|
||||
.filter(userId -> !userId.equals(roomProfile.getUserId()))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
if (CollectionUtils.isEmpty(userIdList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
MemberRolesQryCmd roleQry = new MemberRolesQryCmd().setRoomId(roomId).setUserIds(userIdList);
|
||||
Map<Long, RoomUserRolesEnum> body = roomMemberClient.mapMemberRoles(roleQry).getBody();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user