feat(external-api) Add grantModerator command (#11199)

pull/11204/head jitsi-meet_7087
Robert Pintilii 3 years ago committed by GitHub
parent 35d0fefa1e
commit 9a78011daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      modules/API/API.js
  2. 3
      modules/API/external/external_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);

@ -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',

Loading…
Cancel
Save