|
|
@@ -3,7 +3,8 @@ import { getLogger } from '@jitsi/logger';
|
|
3
|
3
|
import $ from 'jquery';
|
|
4
|
4
|
import { $iq } from 'strophe.js';
|
|
5
|
5
|
|
|
6
|
|
-import { CONNECTION_REDIRECTED } from '../../JitsiConnectionEvents';
|
|
|
6
|
+import { NOT_LIVE_ERROR } from '../../JitsiConnectionErrors';
|
|
|
7
|
+import { CONNECTION_FAILED, CONNECTION_REDIRECTED } from '../../JitsiConnectionEvents';
|
|
7
|
8
|
import Settings from '../settings/Settings';
|
|
8
|
9
|
import Listenable from '../util/Listenable';
|
|
9
|
10
|
|
|
|
@@ -276,6 +277,11 @@ export default class Moderator extends Listenable {
|
|
276
|
277
|
conferenceRequest.properties.sipGatewayEnabled = 'true';
|
|
277
|
278
|
}
|
|
278
|
279
|
|
|
|
280
|
+ // check for explicit false, all other cases is considered live
|
|
|
281
|
+ if ($(resultIq).find('>conference>property[name=\'live\'][value=\'false\']').length > 0) {
|
|
|
282
|
+ conferenceRequest.properties.live = 'false';
|
|
|
283
|
+ }
|
|
|
284
|
+
|
|
279
|
285
|
return conferenceRequest;
|
|
280
|
286
|
}
|
|
281
|
287
|
|
|
|
@@ -387,6 +393,16 @@ export default class Moderator extends Listenable {
|
|
387
|
393
|
this.sipGatewayEnabled = conferenceRequest.properties.sipGatewayEnabled;
|
|
388
|
394
|
logger.info(`Sip gateway enabled: ${this.sipGatewayEnabled}`);
|
|
389
|
395
|
|
|
|
396
|
+ if (conferenceRequest.properties.live === 'false' && this.options.preferVisitor) {
|
|
|
397
|
+ this.getNextTimeout(true);
|
|
|
398
|
+
|
|
|
399
|
+ logger.info('Conference is not live.');
|
|
|
400
|
+
|
|
|
401
|
+ this.xmpp.eventEmitter.emit(CONNECTION_FAILED, NOT_LIVE_ERROR);
|
|
|
402
|
+
|
|
|
403
|
+ return;
|
|
|
404
|
+ }
|
|
|
405
|
+
|
|
390
|
406
|
if (conferenceRequest.ready) {
|
|
391
|
407
|
// Reset the non-error timeout (because we've succeeded here).
|
|
392
|
408
|
this.getNextTimeout(true);
|