Skip to content

Commit

Permalink
feat: Updates userRegion from backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Jan 27, 2025
1 parent 8869b30 commit 8698dd0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ JitsiConference.prototype._init = function(options = {}) {
// creates dominant speaker detection that works only in p2p mode
this.p2pDominantSpeakerDetection = new P2PDominantSpeakerDetection(this);

// We keep this for some time, till all backends are updated to use
// the region from the http requests to prosody, after that we can drop it
if (config && config.deploymentInfo && config.deploymentInfo.userRegion) {
this.setLocalParticipantProperty(
'region', config.deploymentInfo.userRegion);
Expand Down
8 changes: 8 additions & 0 deletions modules/xmpp/ChatRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -652,6 +656,10 @@ export default class ChatRoom extends Listenable {
this.locked = true;
}

if (member.region && this.option?.deploymentInfo) {
this.option.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
Expand Down

0 comments on commit 8698dd0

Please sign in to comment.