浏览代码

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

* Be able to toggle the raise-hand via external_api

* Code Review inputs
j8
BenjaminVega 4 年前
父节点
当前提交
6175a5cad5
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 25 次插入1 次删除
  1. 24
    1
      modules/API/API.js
  2. 1
    0
      modules/API/external/external_api.js

+ 24
- 1
modules/API/API.js 查看文件

@@ -16,7 +16,13 @@ import { overwriteConfig, getWhitelistedJSON } from '../../react/features/base/c
16 16
 import { parseJWTFromURLParams } from '../../react/features/base/jwt';
17 17
 import JitsiMeetJS, { JitsiRecordingConstants } from '../../react/features/base/lib-jitsi-meet';
18 18
 import { MEDIA_TYPE } from '../../react/features/base/media';
19
-import { pinParticipant, getParticipantById, kickParticipant } from '../../react/features/base/participants';
19
+import {
20
+    getLocalParticipant,
21
+    getParticipantById,
22
+    participantUpdated,
23
+    pinParticipant,
24
+    kickParticipant
25
+} from '../../react/features/base/participants';
20 26
 import { setPrivateMessageRecipient } from '../../react/features/chat/actions';
21 27
 import { openChat } from '../../react/features/chat/actions.web';
22 28
 import {
@@ -167,6 +173,23 @@ function initCommands() {
167 173
             sendAnalytics(createApiEvent('chat.toggled'));
168 174
             APP.UI.toggleChat();
169 175
         },
176
+        'toggle-raise-hand': () => {
177
+            const localParticipant = getLocalParticipant(APP.store.getState());
178
+
179
+            if (!localParticipant) {
180
+                return;
181
+            }
182
+            const { raisedHand } = localParticipant;
183
+
184
+            sendAnalytics(createApiEvent('raise-hand.toggled'));
185
+            APP.store.dispatch(
186
+                participantUpdated({
187
+                    id: APP.conference.getMyUserId(),
188
+                    local: true,
189
+                    raisedHand: !raisedHand
190
+                })
191
+            );
192
+        },
170 193
 
171 194
         /**
172 195
          * Callback to invoke when the "toggle-share-screen" command is received.

+ 1
- 0
modules/API/external/external_api.js 查看文件

@@ -52,6 +52,7 @@ const commands = {
52 52
     toggleAudio: 'toggle-audio',
53 53
     toggleChat: 'toggle-chat',
54 54
     toggleFilmStrip: 'toggle-film-strip',
55
+    toggleRaiseHand: 'toggle-raise-hand',
55 56
     toggleShareScreen: 'toggle-share-screen',
56 57
     toggleTileView: 'toggle-tile-view',
57 58
     toggleVideo: 'toggle-video'

正在加载...
取消
保存