Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updates userRegion from backend. #2626

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

@jallamsetty1 jallamsetty1 Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rephrase this to the following so that it grabs attention?
TODO: Drop this after the change to use the region from the http requests to prosody is propagated to all the deployments in production.

// 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
Loading