@@ -274,17 +274,6 @@ public function formatRoomV4(
274
274
}
275
275
}
276
276
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
-
288
277
$ currentUser = null ;
289
278
if ($ attendee ->getActorType () === Attendee::ACTOR_USERS ) {
290
279
$ currentUser = $ this ->userManager ->get ($ attendee ->getActorId ());
@@ -356,6 +345,19 @@ public function formatRoomV4(
356
345
$ roomData ['remoteToken ' ] = $ room ->getRemoteToken ();
357
346
}
358
347
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
+
359
361
// FIXME This should not be done, but currently all the clients use it to get the avatar of the user …
360
362
if ($ room ->getType () === Room::TYPE_ONE_TO_ONE ) {
361
363
$ participants = json_decode ($ room ->getName (), true );
0 commit comments