diff --git a/modules/API/API.js b/modules/API/API.js index 55d460b0c947..e95730a7cb17 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -39,7 +39,8 @@ import { raiseHand, isParticipantModerator, isLocalParticipantModerator, - hasRaisedHand + hasRaisedHand, + grantModerator } from '../../react/features/base/participants'; import { updateSettings } from '../../react/features/base/settings'; import { isToggleCameraEnabled, toggleCamera } from '../../react/features/base/tracks'; @@ -164,6 +165,14 @@ function initCommands() { } APP.store.dispatch(autoAssignToBreakoutRooms()); }, + 'grant-moderator': participantId => { + if (!isLocalParticipantModerator(APP.store.getState())) { + logger.error('Missing moderator rights to grant moderator right to another participant'); + + return; + } + APP.store.dispatch(grantModerator(participantId)); + }, 'display-name': displayName => { sendAnalytics(createApiEvent('display.name.changed')); APP.conference.changeLocalDisplayName(displayName); diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 88d7d09e0643..cce51a57328b 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -38,7 +38,7 @@ const commands = { displayName: 'display-name', e2eeKey: 'e2ee-key', email: 'email', - toggleLobby: 'toggle-lobby', + grantModerator: 'grant-moderator', hangup: 'video-hangup', initiatePrivateChat: 'initiate-private-chat', joinBreakoutRoom: 'join-breakout-room', @@ -73,6 +73,7 @@ const commands = { toggleChat: 'toggle-chat', toggleE2EE: 'toggle-e2ee', toggleFilmStrip: 'toggle-film-strip', + toggleLobby: 'toggle-lobby', toggleModeration: 'toggle-moderation', toggleParticipantsPane: 'toggle-participants-pane', toggleRaiseHand: 'toggle-raise-hand',