Be able to toggle the raise-hand via external-api (#8838)

* Be able to toggle the raise-hand via external_api

* Code Review inputs
This commit is contained in:
BenjaminVega 2021-03-22 17:22:45 +01:00 committed by GitHub
parent 678f3e232b
commit 6175a5cad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View File

@ -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.

View File

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