diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index d7b4772..25ef2d3 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -331,7 +331,7 @@ export default class RoomClient text : 'You are logged in.' })); this.changeDisplayName(displayName); - this.changePicture(picture); + this.changePicture(picture) } _soundNotification() @@ -658,6 +658,8 @@ export default class RoomClient stateActions.addLobbyPeer(peer.peerId)); store.dispatch( stateActions.setLobbyPeerDisplayName(peer.displayName)); + store.dispatch( + stateActions.setLobbyPeerPicture(peer.picture)); }); (accessCode != null) && store.dispatch( @@ -1415,6 +1417,21 @@ export default class RoomClient break; } + case 'lobby:changePicture': + { + const { peerId, picture } = notification.data; + + store.dispatch( + stateActions.setLobbyPeerPicture(picture, peerId)); + + store.dispatch(requestActions.notify( + { + text : `Participant in lobby changed picture.` + })); + + break; + } + case 'setAccessCode': { const { accessCode } = notification.data; diff --git a/app/src/actions/stateActions.js b/app/src/actions/stateActions.js index f0b030b..55ba6fb 100644 --- a/app/src/actions/stateActions.js +++ b/app/src/actions/stateActions.js @@ -461,6 +461,14 @@ export const setLobbyPeerDisplayName = (displayName, peerId) => }; }; +export const setLobbyPeerPicture = (picture, peerId) => +{ + return { + type : 'SET_LOBBY_PEER_PICTURE', + payload : { picture, peerId } + }; +}; + export const setLobbyPeerPromotionInProgress = (peerId, flag) => { return { diff --git a/app/src/reducers/lobbyPeers.js b/app/src/reducers/lobbyPeers.js index 9b905ed..7bef39f 100644 --- a/app/src/reducers/lobbyPeers.js +++ b/app/src/reducers/lobbyPeers.js @@ -7,7 +7,10 @@ const lobbyPeer = (state = {}, action) => case 'SET_LOBBY_PEER_DISPLAY_NAME': return { ...state, displayName: action.payload.displayName }; - + + case 'SET_LOBBY_PEER_PICTURE': + return { ...state, picture: action.payload.picture }; + case 'SET_LOBBY_PEER_PROMOTION_IN_PROGRESS': return { ...state, promotionInProgress: action.payload.flag }; diff --git a/server/lib/Lobby.js b/server/lib/Lobby.js index c1cda33..4eebcf0 100644 --- a/server/lib/Lobby.js +++ b/server/lib/Lobby.js @@ -91,9 +91,6 @@ class Lobby extends EventEmitter this._notification(peer.socket, 'enteredLobby'); - if (config.requireSignInToAccess && !peer.authenticated && !super.isLocked()) - this._notification(peer.socket, 'signInRequired'); - this._peers.set(peer.id, peer); peer.on('authenticationChanged', () => diff --git a/server/lib/Room.js b/server/lib/Room.js index 97eab18..7f604a3 100644 --- a/server/lib/Room.js +++ b/server/lib/Room.js @@ -133,6 +133,9 @@ class Room extends EventEmitter { this._parkPeer(peer); + if (!this._locked) + this._notification(peer.socket, 'signInRequired'); + return; }