Ver código fonte

feat: Updates userRegion from backend. (#2626)

* feat: Updates userRegion from backend.

* squash: Update comment.

* squash: Fix options.
release-8443
Дамян Минков 10 meses atrás
pai
commit
0d3304b7d4
Nenhuma conta vinculada ao e-mail do autor do commit
2 arquivos alterados com 10 adições e 0 exclusões
  1. 2
    0
      JitsiConference.js
  2. 8
    0
      modules/xmpp/ChatRoom.js

+ 2
- 0
JitsiConference.js Ver arquivo

@@ -560,6 +560,8 @@ JitsiConference.prototype._init = function(options = {}) {
560 560
     // creates dominant speaker detection that works only in p2p mode
561 561
     this.p2pDominantSpeakerDetection = new P2PDominantSpeakerDetection(this);
562 562
 
563
+    // TODO: Drop this after the change to use the region from the http requests
564
+    //  to prosody is propagated to majority of deployments
563 565
     if (config && config.deploymentInfo && config.deploymentInfo.userRegion) {
564 566
         this.setLocalParticipantProperty(
565 567
             'region', config.deploymentInfo.userRegion);

+ 8
- 0
modules/xmpp/ChatRoom.js Ver arquivo

@@ -605,6 +605,10 @@ export default class ChatRoom extends Listenable {
605 605
                 member.features = this._extractFeatures(node);
606 606
                 break;
607 607
             }
608
+            case 'jitsi_participant_region': {
609
+                member.region = node.value;
610
+                break;
611
+            }
608 612
             case 'stat': {
609 613
                 const { attributes } = node;
610 614
 
@@ -652,6 +656,10 @@ export default class ChatRoom extends Listenable {
652 656
                     this.locked = true;
653 657
                 }
654 658
 
659
+                if (member.region && this.options?.deploymentInfo) {
660
+                    this.options.deploymentInfo.userRegion = member.region;
661
+                }
662
+
655 663
                 // Re-send presence in case any presence updates were added,
656 664
                 // but blocked from sending, during the join process.
657 665
                 // send the presence only if there was a modification after we had synced it

Carregando…
Cancelar
Salvar