diff --git a/app/src/Room.js b/app/src/Room.js index 242f21d2..417ba58b 100644 --- a/app/src/Room.js +++ b/app/src/Room.js @@ -107,6 +107,7 @@ module.exports = class Room { shareMediaData: this.shareMediaData, dominantSpeaker: this.activeSpeakerObserverEnabled, peers: JSON.stringify([...this.peers]), + peersCount: this.getPeersCount(), maxParticipants: this.maxParticipants, maxParticipantsReached: this.peers.size > this.maxParticipants, globalLobby: this.globalLobby, diff --git a/app/src/Server.js b/app/src/Server.js index 0e5d02b7..b1298577 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -1923,7 +1923,7 @@ function startServer() { return cb('isLocked'); } - if (room.isLobbyEnabled() && !isPresenter) { + if ((room.isLobbyEnabled() || room.isGlobalLobbyEnabled()) && !isPresenter) { log.debug( 'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter' ); @@ -1935,11 +1935,6 @@ function startServer() { return cb('isLobby'); } - if (room.isGlobalLobbyEnabled() && !isPresenter) { - log.debug('The user is currently waiting to join the room because the global lobby is enabled'); - return cb('isGlobalLobby'); - } - if ((hostCfg.protected || hostCfg.user_auth) && isPresenter && !hostCfg.users_from_db) { const roomAllowedForUser = isRoomAllowedForUser('[Join]', peer_name, room.id); if (!roomAllowedForUser) { @@ -2409,6 +2404,10 @@ function startServer() { room.setLocked(false); room.broadCast(socket.id, 'roomAction', data.action); break; + case 'globalLobbyOn': + if (!room.isGlobalLobbyEnabled()) return; + room.setLobbyEnabled(true); + break; case 'lobbyOn': if (!isPresenter) return; room.setLobbyEnabled(true); diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 7e16a5c4..389ed9df 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -517,11 +517,6 @@ class RoomClient { return this.unlockTheRoom(); } - if (room === 'isGlobalLobby') { - console.warn('00-WARNING ----> Room GLOBAL Lobby Enabled, Try later presenter not in room'); - return this.presenterNotInRoom(); - } - if (room === 'isLobby') { this.RoomIsLobby = true; this.event(_EVENTS.lobbyOn); @@ -620,10 +615,15 @@ class RoomClient { this.getId('isUserPresenter').innerText = isPresenter; window.localStorage.isReconnected = false; + // GLOBAL LOBBY ENABLED if (room?.globalLobby) { - localStorageSettings.lobby = true; - lS.setSettings(localStorageSettings); - console.warn('7.1-WARNING ----> GLOBAL Room Lobby detected, save the config'); + if (isPresenter) { + localStorageSettings.lobby = true; + lS.setSettings(localStorageSettings); + console.warn('7.1-WARNING ----> GLOBAL Room Lobby detected, save the config'); + } + rc.roomAction('globalLobbyOn', true, false); + console.warn('7.1-WARNING ----> GLOBAL Room Lobby detected'); } handleRules(isPresenter);