From 17cace070e759a335f1fd96109237a5eec1e9326 Mon Sep 17 00:00:00 2001 From: Shawn Date: Fri, 16 Sep 2022 13:29:54 +0100 Subject: [PATCH] feat(external-api) Add endConference command --- modules/API/API.js | 14 ++++++++++++++ modules/API/external/external_api.js | 1 + 2 files changed, 15 insertions(+) diff --git a/modules/API/API.js b/modules/API/API.js index 2bcd55afc..2330faae2 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -18,6 +18,7 @@ import { } from '../../react/features/av-moderation/actions'; import { isEnabledFromState } from '../../react/features/av-moderation/functions'; import { + endConference, getCurrentConference, sendTones, setFollowMe, @@ -777,6 +778,19 @@ function initCommands() { }, 'toggle-virtual-background': () => { APP.store.dispatch(toggleDialog(VirtualBackgroundDialog)); + }, + 'end-conference': () => { + APP.store.dispatch(endConference()); + const state = APP.store.getState(); + const conference = getCurrentConference(state); + + if (!conference) { + logger.error('Conference not yet available'); + } else if (conference.isEndConferenceSupported()) { + APP.store.dispatch(endConference()); + } else { + logger.error(' End Conference not supported'); + } } }; transport.on('event', ({ data, name }) => { diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 40bda25a2..d8b290245 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -37,6 +37,7 @@ const commands = { closeBreakoutRoom: 'close-breakout-room', displayName: 'display-name', e2eeKey: 'e2ee-key', + endConference: 'end-conference', email: 'email', grantModerator: 'grant-moderator', hangup: 'video-hangup',