diff --git a/JitsiConference.js b/JitsiConference.js index 6c899ec8ef..8f1d76837c 100644 --- a/JitsiConference.js +++ b/JitsiConference.js @@ -560,6 +560,8 @@ JitsiConference.prototype._init = function(options = {}) { // creates dominant speaker detection that works only in p2p mode this.p2pDominantSpeakerDetection = new P2PDominantSpeakerDetection(this); + // TODO: Drop this after the change to use the region from the http requests + // to prosody is propagated to majority of deployments if (config && config.deploymentInfo && config.deploymentInfo.userRegion) { this.setLocalParticipantProperty( 'region', config.deploymentInfo.userRegion); diff --git a/modules/xmpp/ChatRoom.js b/modules/xmpp/ChatRoom.js index 19d278fd90..91349e44e1 100644 --- a/modules/xmpp/ChatRoom.js +++ b/modules/xmpp/ChatRoom.js @@ -605,6 +605,10 @@ export default class ChatRoom extends Listenable { member.features = this._extractFeatures(node); break; } + case 'jitsi_participant_region': { + member.region = node.value; + break; + } case 'stat': { const { attributes } = node; @@ -652,6 +656,10 @@ export default class ChatRoom extends Listenable { this.locked = true; } + if (member.region && this.options?.deploymentInfo) { + this.options.deploymentInfo.userRegion = member.region; + } + // Re-send presence in case any presence updates were added, // but blocked from sending, during the join process. // send the presence only if there was a modification after we had synced it