Browse Source

feat: Moves vnode handle from conferenceIQ error to success response.

<conference xmlns="http://jitsi.org/protocol/focus" vnode="v1" ready="true" room="roomtest@conference.focus.exmaple.com" focusjid="focus@auth.meet.jitsi">
    <property name="authentication" value="false"/>
    <property name="sipGatewayEnabled" value="true"/>
</conference>
dev1
damencho 2 years ago
parent
commit
a25023e7a7
1 changed files with 11 additions and 14 deletions
  1. 11
    14
      modules/xmpp/moderator.js

+ 11
- 14
modules/xmpp/moderator.js View File

@@ -345,20 +345,6 @@ Moderator.prototype._allocateConferenceFocusError = function(error, callback) {
345 345
         return;
346 346
     }
347 347
 
348
-    // redirect
349
-    if ($(error).find('>error>redirect').length) {
350
-        const conferenceIQError = $(error).find('conference');
351
-
352
-        const vnode = conferenceIQError.attr('vnode');
353
-        const focusJid = conferenceIQError.attr('focusjid');
354
-
355
-        logger.warn(`We have been redirected to: ${vnode} new focus Jid:${focusJid}`);
356
-
357
-        this.eventEmitter.emit(XMPPEvents.REDIRECTED, vnode, focusJid);
358
-
359
-        return;
360
-    }
361
-
362 348
     const waitMs = this.getNextErrorTimeout();
363 349
     const errmsg = `Focus error, retry after ${waitMs}`;
364 350
 
@@ -409,6 +395,17 @@ Moderator.prototype._allocateConferenceFocusSuccess = function(
409 395
         // Reset the non-error timeout (because we've succeeded here).
410 396
         this.getNextTimeout(true);
411 397
 
398
+        const vnode = $(result).find('conference')
399
+            .attr('vnode');
400
+
401
+        if (vnode) {
402
+            logger.warn(`We have been redirected to: ${vnode} new focus Jid:${this.getFocusUserJid()}`);
403
+
404
+            this.eventEmitter.emit(XMPPEvents.REDIRECTED, vnode, this.getFocusUserJid());
405
+
406
+            return;
407
+        }
408
+
412 409
         // Exec callback
413 410
         callback();
414 411
     } else {

Loading…
Cancel
Save