diff options
author | Joas Schilling <coding@schilljs.com> | 2019-07-04 16:33:16 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-08-28 11:28:05 +0300 |
commit | 36e3da092c496d7fbde7fa31c81064605bb99ca8 (patch) | |
tree | e52b431c3dcf33984fc876423d381aec696acc94 /lib | |
parent | 7f0dd779512e572d2040c86800fb8a3ea5cf3e64 (diff) |
No participants and chat messages for users in the lobby
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/RoomController.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 30aa3aaac..549bd4cf7 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -216,6 +216,8 @@ class RoomController extends AEnvironmentAwareController { 'lastActivity' => $lastActivity, 'isFavorite' => $currentParticipant->isFavorite(), 'notificationLevel' => $currentParticipant->getNotificationLevel(), + 'lastPing' => $currentParticipant->getLastPing(), + 'sessionId' => $currentParticipant->getSessionId(), ]); if ($roomData['notificationLevel'] === Participant::NOTIFY_DEFAULT) { @@ -226,6 +228,12 @@ class RoomController extends AEnvironmentAwareController { } } + if ($room->getLobbyState() === Webinary::MODERATORS_ONLY && + !$currentParticipant->hasModeratorPermissions()) { + // No participants and chat messages for users in the lobby. + return $roomData; + } + $currentUser = $this->userManager->get($currentParticipant->getUser()); if ($currentUser instanceof IUser) { $lastReadMessage = $currentParticipant->getLastReadMessage(); @@ -295,8 +303,6 @@ class RoomController extends AEnvironmentAwareController { } $roomData = array_merge($roomData, [ - 'lastPing' => $currentParticipant->getLastPing(), - 'sessionId' => $currentParticipant->getSessionId(), 'participants' => $participantList, 'numGuests' => $numActiveGuests, 'lastMessage' => $lastMessage, |