Skip to content

Commit 5de4d34

Browse files
Antreesybackportbot[bot]
authored andcommitted
fix(LeftSidebar): fetch room if user was in the lobby
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 8fb094c commit 5de4d34

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

lib/Service/RoomFormatter.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,6 @@ public function formatRoomV4(
274274
}
275275
}
276276

277-
if ($room->getLobbyState() === Webinary::LOBBY_NON_MODERATORS &&
278-
!$currentParticipant->hasModeratorPermissions() &&
279-
!($currentParticipant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) {
280-
// No participants and chat messages for users in the lobby.
281-
$roomData['hasCall'] = false;
282-
$roomData['canLeaveConversation'] = true;
283-
return $roomData;
284-
}
285-
286-
$roomData['canStartCall'] = $currentParticipant->canStartCall($this->serverConfig);
287-
288277
$currentUser = null;
289278
if ($attendee->getActorType() === Attendee::ACTOR_USERS) {
290279
$currentUser = $this->userManager->get($attendee->getActorId());
@@ -356,6 +345,19 @@ public function formatRoomV4(
356345
$roomData['remoteToken'] = $room->getRemoteToken();
357346
}
358347

348+
if ($room->getLobbyState() === Webinary::LOBBY_NON_MODERATORS &&
349+
!$currentParticipant->hasModeratorPermissions() &&
350+
!($currentParticipant->getPermissions() & Attendee::PERMISSIONS_LOBBY_IGNORE)) {
351+
// No participants and chat messages for users in the lobby.
352+
$roomData['hasCall'] = false;
353+
$roomData['unreadMessages'] = 0;
354+
$roomData['unreadMention'] = false;
355+
$roomData['unreadMentionDirect'] = false;
356+
return $roomData;
357+
}
358+
359+
$roomData['canStartCall'] = $currentParticipant->canStartCall($this->serverConfig);
360+
359361
// FIXME This should not be done, but currently all the clients use it to get the avatar of the user …
360362
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
361363
$participants = json_decode($room->getName(), true);

0 commit comments

Comments
 (0)