Skip to content

Commit 0d3304b

Browse files
authored
feat: Updates userRegion from backend. (#2626)
* feat: Updates userRegion from backend. * squash: Update comment. * squash: Fix options.
1 parent dfc23df commit 0d3304b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

JitsiConference.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ JitsiConference.prototype._init = function(options = {}) {
560560
// creates dominant speaker detection that works only in p2p mode
561561
this.p2pDominantSpeakerDetection = new P2PDominantSpeakerDetection(this);
562562

563+
// TODO: Drop this after the change to use the region from the http requests
564+
// to prosody is propagated to majority of deployments
563565
if (config && config.deploymentInfo && config.deploymentInfo.userRegion) {
564566
this.setLocalParticipantProperty(
565567
'region', config.deploymentInfo.userRegion);

modules/xmpp/ChatRoom.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ export default class ChatRoom extends Listenable {
605605
member.features = this._extractFeatures(node);
606606
break;
607607
}
608+
case 'jitsi_participant_region': {
609+
member.region = node.value;
610+
break;
611+
}
608612
case 'stat': {
609613
const { attributes } = node;
610614

@@ -652,6 +656,10 @@ export default class ChatRoom extends Listenable {
652656
this.locked = true;
653657
}
654658

659+
if (member.region && this.options?.deploymentInfo) {
660+
this.options.deploymentInfo.userRegion = member.region;
661+
}
662+
655663
// Re-send presence in case any presence updates were added,
656664
// but blocked from sending, during the join process.
657665
// send the presence only if there was a modification after we had synced it

0 commit comments

Comments
 (0)