Simplify participantlist and order participants based on status. Raise hand queue, and moderator can remove raised hand. Fixes #146, #278

This commit is contained in:
Håvar Aambø Fosstveit
2020-05-06 01:40:08 +02:00
parent fa5f4f02a6
commit 136037d83f
8 changed files with 168 additions and 57 deletions
+23
View File
@@ -1430,6 +1430,29 @@ class Room extends EventEmitter
break;
}
case 'moderator:lowerHand':
{
if (
!peer.roles.some(
(role) => permissionsFromRoles.MODERATE_ROOM.includes(role)
)
)
throw new Error('peer not authorized');
const { peerId } = request.data;
const lowerPeer = this._peers[peerId];
if (!lowerPeer)
throw new Error(`peer with id "${peerId}" not found`);
this._notification(lowerPeer.socket, 'moderator:lowerHand');
cb();
break;
}
default:
{
logger.error('unknown request.method "%s"', request.method);