Don't send lobbypeers to client if they don't have PROMOTE_PEER role, fixes #208

auto_join_3.3
Håvar Aambø Fosstveit 2020-05-06 22:22:57 +02:00
parent 1cbf2d5b38
commit c1aa62d22c
1 changed files with 8 additions and 1 deletions

View File

@ -669,7 +669,14 @@ class Room extends EventEmitter
.filter((joinedPeer) => joinedPeer.id !== peer.id)
.map((joinedPeer) => (joinedPeer.peerInfo));
const lobbyPeers = this._lobby.peerList();
let lobbyPeers = [];
if ( // Allowed to promote peers, notify about lobbypeers
peer.roles.some((role) =>
permissionsFromRoles.PROMOTE_PEER.includes(role)
)
)
lobbyPeers = this._lobby.peerList();
cb(null, {
roles : peer.roles,