Sfoglia il codice sorgente

fix(flags): Init flags before creating XMPP conn.

This allows us to set defaults through jitsi-meet. Also remove undocumented setting enableJoinAsVisitor that is no longer needed.
release-8443
Jaya Allamsetty 1 anno fa
parent
commit
9b11d097e5
5 ha cambiato i file con 7 aggiunte e 19 eliminazioni
  1. 5
    0
      JitsiConnection.js
  2. 0
    4
      JitsiMeetJS.ts
  3. 0
    10
      modules/flags/FeatureFlags.js
  4. 1
    2
      modules/xmpp/moderator.js
  5. 1
    3
      modules/xmpp/xmpp.js

+ 5
- 0
JitsiConnection.js Vedi File

@@ -1,5 +1,6 @@
1 1
 import JitsiConference from './JitsiConference';
2 2
 import * as JitsiConnectionEvents from './JitsiConnectionEvents';
3
+import FeatureFlags from './modules/flags/FeatureFlags';
3 4
 import Statistics from './modules/statistics/statistics';
4 5
 import XMPP from './modules/xmpp/xmpp';
5 6
 import {
@@ -21,6 +22,10 @@ export default function JitsiConnection(appID, token, options) {
21 22
     this.appID = appID;
22 23
     this.token = token;
23 24
     this.options = options;
25
+
26
+    // Initialize the feature flags so that they are advertised through the disco-info.
27
+    FeatureFlags.init(options.flags || {});
28
+
24 29
     this.xmpp = new XMPP(options, token);
25 30
 
26 31
     /* eslint-disable max-params */

+ 0
- 4
JitsiMeetJS.ts Vedi File

@@ -150,10 +150,6 @@ export default {
150 150
 
151 151
         Settings.init(options.externalStorage);
152 152
         Statistics.init(options);
153
-        const flags = options.flags || {};
154
-
155
-        // Configure the feature flags.
156
-        FeatureFlags.init(flags);
157 153
 
158 154
         // Initialize global window.connectionTimes
159 155
         // FIXME do not use 'window'

+ 0
- 10
modules/flags/FeatureFlags.js Vedi File

@@ -11,12 +11,10 @@ class FeatureFlags {
11 11
      * @param {object} flags - The feature flags.
12 12
      * @param {boolean=} flags.runInLiteMode - Enables lite mode for testing to disable media decoding.
13 13
      * @param {boolean=} flags.ssrcRewritingEnabled - Use SSRC rewriting.
14
-     * @param {boolean=} flags.enableJoinAsVisitor - Enable joining as a visitor.
15 14
      */
16 15
     init(flags) {
17 16
         this._runInLiteMode = Boolean(flags.runInLiteMode);
18 17
         this._ssrcRewriting = Boolean(flags.ssrcRewritingEnabled);
19
-        this._joinAsVisitor = Boolean(flags.enableJoinAsVisitor ?? true);
20 18
     }
21 19
 
22 20
     /**
@@ -37,14 +35,6 @@ class FeatureFlags {
37 35
     isSsrcRewritingSupported() {
38 36
         return this._ssrcRewriting;
39 37
     }
40
-
41
-    /**
42
-     * Checks if the clients supports joining as a visitor.
43
-     * @returns {boolean}
44
-     */
45
-    isJoinAsVisitorSupported() {
46
-        return this._joinAsVisitor;
47
-    }
48 38
 }
49 39
 
50 40
 export default new FeatureFlags();

+ 1
- 2
modules/xmpp/moderator.js Vedi File

@@ -4,7 +4,6 @@ import $ from 'jquery';
4 4
 import { $iq } from 'strophe.js';
5 5
 
6 6
 import { CONNECTION_REDIRECTED } from '../../JitsiConnectionEvents';
7
-import FeatureFlags from '../flags/FeatureFlags';
8 7
 import Settings from '../settings/Settings';
9 8
 import Listenable from '../util/Listenable';
10 9
 
@@ -190,7 +189,7 @@ export default class Moderator extends Listenable {
190 189
             conferenceRequest.sessionId = sessionId;
191 190
         }
192 191
 
193
-        if (FeatureFlags.isJoinAsVisitorSupported() && !config.iAmRecorder && !config.iAmSipGateway) {
192
+        if (!config.iAmRecorder && !config.iAmSipGateway) {
194 193
             conferenceRequest.properties['visitors-version'] = 1;
195 194
 
196 195
             if (this.options.preferVisitor) {

+ 1
- 3
modules/xmpp/xmpp.js Vedi File

@@ -263,9 +263,7 @@ export default class XMPP extends Listenable {
263 263
         // the version added in moderator.js, this one here is mostly defined
264 264
         // for keeping stats, since it is not made available to jocofo at
265 265
         // the time of the initial conference-request.
266
-        if (FeatureFlags.isJoinAsVisitorSupported()) {
267
-            this.caps.addFeature('http://jitsi.org/visitors-1');
268
-        }
266
+        this.caps.addFeature('http://jitsi.org/visitors-1');
269 267
     }
270 268
 
271 269
     /**

Loading…
Annulla
Salva