From 2e2d40c1d0c288d37551654a4f84f124d501179b Mon Sep 17 00:00:00 2001 From: Alejandro Blanco Date: Tue, 19 May 2020 08:50:21 +0200 Subject: [PATCH] external-api: add muteEveryone command --- modules/API/API.js | 12 +++++++++++- modules/API/external/external_api.js | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/API/API.js b/modules/API/API.js index 791e7c4ee..b95a571c9 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -16,7 +16,7 @@ import { invite } from '../../react/features/invite'; import { toggleTileView } from '../../react/features/video-layout'; import { setVideoQuality } from '../../react/features/video-quality'; import { getJitsiMeetTransport } from '../transport'; - +import { muteAllParticipants } from '../../react/features/remote-video-menu/actions'; import { API_ID, ENDPOINT_TEXT_MESSAGE_NAME } from './constants'; import { processExternalDeviceRequest @@ -71,6 +71,16 @@ function initCommands() { sendAnalytics(createApiEvent('display.name.changed')); APP.conference.changeLocalDisplayName(displayName); }, + 'mute-everyone': () => { + sendAnalytics(createApiEvent('muted-everyone')); + const participants = APP.store.getState()['features/base/participants']; + const localIds = participants + .filter(participant => participant.local) + .filter(participant => participant.role === 'moderator') + .map(participant => participant.id); + + APP.store.dispatch(muteAllParticipants(localIds)); + }, 'password': password => { const { conference, passwordRequired } = APP.store.getState()['features/base/conference']; diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 1cba279d2..347756964 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -32,6 +32,7 @@ const commands = { e2eeKey: 'e2ee-key', email: 'email', hangup: 'video-hangup', + muteEveryone: 'mute-everyone', password: 'password', sendEndpointTextMessage: 'send-endpoint-text-message', sendTones: 'send-tones',