Преглед на файлове

feat(replace-participant): Add replaceParticipant feature-flag

master
tmoldovan8x8 преди 4 години
родител
ревизия
0bd45a75d2
No account linked to committer's email address

+ 3
- 3
conference.js Целия файл

45
     p2pStatusChanged,
45
     p2pStatusChanged,
46
     sendLocalParticipant
46
     sendLocalParticipant
47
 } from './react/features/base/conference';
47
 } from './react/features/base/conference';
48
+import { getReplaceParticipant } from './react/features/base/config/functions';
48
 import {
49
 import {
49
     checkAndNotifyForNewDevice,
50
     checkAndNotifyForNewDevice,
50
     getAvailableDevices,
51
     getAvailableDevices,
304
 
305
 
305
         // not enough rights to create conference
306
         // not enough rights to create conference
306
         case JitsiConferenceErrors.AUTHENTICATION_REQUIRED: {
307
         case JitsiConferenceErrors.AUTHENTICATION_REQUIRED: {
307
-            const { replaceParticipant }
308
-                = APP.store.getState()['features/base/config'];
309
 
308
 
309
+            const replaceParticipant = getReplaceParticipant(APP.store.getState());
310
 
310
 
311
             // Schedule reconnect to check if someone else created the room.
311
             // Schedule reconnect to check if someone else created the room.
312
             this.reconnectTimeout = setTimeout(() => {
312
             this.reconnectTimeout = setTimeout(() => {
397
      *
397
      *
398
      */
398
      */
399
     connect() {
399
     connect() {
400
-        const { replaceParticipant } = APP.store.getState()['features/base/config'];
400
+        const replaceParticipant = getReplaceParticipant(APP.store.getState());
401
 
401
 
402
         // the local storage overrides here and in connection.js can be used by jibri
402
         // the local storage overrides here and in connection.js can be used by jibri
403
         room.join(jitsiLocalStorage.getItem('xmpp_conference_password_override'), replaceParticipant);
403
         room.join(jitsiLocalStorage.getItem('xmpp_conference_password_override'), replaceParticipant);

+ 2
- 2
modules/UI/authentication/AuthHandler.js Целия файл

11
     isTokenAuthEnabled,
11
     isTokenAuthEnabled,
12
     getTokenAuthUrl
12
     getTokenAuthUrl
13
 } from '../../../react/features/authentication/functions';
13
 } from '../../../react/features/authentication/functions';
14
+import { getReplaceParticipant } from '../../../react/features/base/config/functions';
14
 import { isDialogOpen } from '../../../react/features/base/dialog';
15
 import { isDialogOpen } from '../../../react/features/base/dialog';
15
 import { setJWT } from '../../../react/features/base/jwt';
16
 import { setJWT } from '../../../react/features/base/jwt';
16
 import UIUtil from '../util/UIUtil';
17
 import UIUtil from '../util/UIUtil';
209
     }).then(url => {
210
     }).then(url => {
210
         // de-authenticate conference on the fly
211
         // de-authenticate conference on the fly
211
         if (room.isJoined()) {
212
         if (room.isJoined()) {
212
-            const { replaceParticipant }
213
-                = APP.store.getState()['features/base/config'];
213
+            const replaceParticipant = getReplaceParticipant(APP.store.getState());
214
 
214
 
215
             room.join(null, replaceParticipant);
215
             room.join(null, replaceParticipant);
216
         }
216
         }

+ 5
- 3
react/features/base/conference/actions.js Целия файл

8
 } from '../../analytics';
8
 } from '../../analytics';
9
 import { getName } from '../../app/functions';
9
 import { getName } from '../../app/functions';
10
 import { endpointMessageReceived } from '../../subtitles';
10
 import { endpointMessageReceived } from '../../subtitles';
11
+import { getReplaceParticipant } from '../config/functions';
11
 import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection';
12
 import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection';
12
 import { JitsiConferenceEvents } from '../lib-jitsi-meet';
13
 import { JitsiConferenceEvents } from '../lib-jitsi-meet';
13
 import { MEDIA_TYPE, setAudioMuted, setVideoMuted } from '../media';
14
 import { MEDIA_TYPE, setAudioMuted, setVideoMuted } from '../media';
460
 
461
 
461
         sendLocalParticipant(state, conference);
462
         sendLocalParticipant(state, conference);
462
 
463
 
463
-        conference.join(password, config.replaceParticipant);
464
+        const replaceParticipant = getReplaceParticipant(state);
465
+
466
+        conference.join(password, replaceParticipant);
464
     };
467
     };
465
 }
468
 }
466
 
469
 
477
         const { authRequired, password }
480
         const { authRequired, password }
478
             = getState()['features/base/conference'];
481
             = getState()['features/base/conference'];
479
 
482
 
480
-        const { replaceParticipant }
481
-            = getState()['features/base/config'];
483
+        const replaceParticipant = getReplaceParticipant(APP.store.getState());
482
 
484
 
483
         authRequired && dispatch(_conferenceWillJoin(authRequired));
485
         authRequired && dispatch(_conferenceWillJoin(authRequired));
484
         authRequired && authRequired.join(password, replaceParticipant);
486
         authRequired && authRequired.join(password, replaceParticipant);

+ 12
- 0
react/features/base/config/functions.native.js Целия файл

2
 
2
 
3
 import { NativeModules } from 'react-native';
3
 import { NativeModules } from 'react-native';
4
 
4
 
5
+import { getFeatureFlag, REPLACE_PARTICIPANT } from '../flags';
6
+
5
 export * from './functions.any';
7
 export * from './functions.any';
6
 
8
 
7
 /**
9
 /**
19
         delete config.callStatsSecret;
21
         delete config.callStatsSecret;
20
     }
22
     }
21
 }
23
 }
24
+
25
+/**
26
+ * Returns the replaceParticipant config.
27
+ *
28
+ * @param {Object} state - The state of the app.
29
+ * @returns {boolean}
30
+ */
31
+export function getReplaceParticipant(state: Object): string {
32
+    return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
33
+}

+ 10
- 0
react/features/base/config/functions.web.js Целия файл

33
     return state['features/base/config'].guestDialOutUrl;
33
     return state['features/base/config'].guestDialOutUrl;
34
 }
34
 }
35
 
35
 
36
+/**
37
+ * Returns the replaceParticipant config.
38
+ *
39
+ * @param {Object} state - The state of the app.
40
+ * @returns {boolean}
41
+ */
42
+export function getReplaceParticipant(state: Object): string {
43
+    return state['features/base/config'].replaceParticipant;
44
+}
45
+
36
 /**
46
 /**
37
  * Returns the list of enabled toolbar buttons.
47
  * Returns the list of enabled toolbar buttons.
38
  *
48
  *

+ 6
- 0
react/features/base/flags/constants.js Целия файл

154
  */
154
  */
155
 export const RECORDING_ENABLED = 'recording.enabled';
155
 export const RECORDING_ENABLED = 'recording.enabled';
156
 
156
 
157
+/**
158
+ * Flag indicating if the user should join the conference with the replaceParticipant functionality.
159
+ * Default: (false).
160
+ */
161
+export const REPLACE_PARTICIPANT = 'replace.participant';
162
+
157
 /**
163
 /**
158
  * Flag indicating the local and (maximum) remote video resolution. Overrides
164
  * Flag indicating the local and (maximum) remote video resolution. Overrides
159
  * the server configuration.
165
  * the server configuration.

Loading…
Отказ
Запис