diff --git a/modules/API/API.js b/modules/API/API.js index a23b78c8d..2f3d1bff8 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -16,7 +16,13 @@ import { overwriteConfig, getWhitelistedJSON } from '../../react/features/base/c import { parseJWTFromURLParams } from '../../react/features/base/jwt'; import JitsiMeetJS, { JitsiRecordingConstants } from '../../react/features/base/lib-jitsi-meet'; import { MEDIA_TYPE } from '../../react/features/base/media'; -import { pinParticipant, getParticipantById, kickParticipant } from '../../react/features/base/participants'; +import { + getLocalParticipant, + getParticipantById, + participantUpdated, + pinParticipant, + kickParticipant +} from '../../react/features/base/participants'; import { setPrivateMessageRecipient } from '../../react/features/chat/actions'; import { openChat } from '../../react/features/chat/actions.web'; import { @@ -167,6 +173,23 @@ function initCommands() { sendAnalytics(createApiEvent('chat.toggled')); APP.UI.toggleChat(); }, + 'toggle-raise-hand': () => { + const localParticipant = getLocalParticipant(APP.store.getState()); + + if (!localParticipant) { + return; + } + const { raisedHand } = localParticipant; + + sendAnalytics(createApiEvent('raise-hand.toggled')); + APP.store.dispatch( + participantUpdated({ + id: APP.conference.getMyUserId(), + local: true, + raisedHand: !raisedHand + }) + ); + }, /** * Callback to invoke when the "toggle-share-screen" command is received. diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index ba8182427..a66b42ff4 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -52,6 +52,7 @@ const commands = { toggleAudio: 'toggle-audio', toggleChat: 'toggle-chat', toggleFilmStrip: 'toggle-film-strip', + toggleRaiseHand: 'toggle-raise-hand', toggleShareScreen: 'toggle-share-screen', toggleTileView: 'toggle-tile-view', toggleVideo: 'toggle-video'