Skip to content

Commit

Permalink
fix(visitors): Fixes replacing visitor domain. (#14457)
Browse files Browse the repository at this point in the history
* fix(visitors): Fixes replacing visitor domain.

Constructing the visitor room jid instead of doing a risky replacement.

The problem is having a room like:
[meet-jit-si-shard]someroomname@conference.meet.jit.si and replacing with 'meet.jit.si', the dots match the -.
  • Loading branch information
damencho authored Mar 8, 2024
1 parent 1c81b93 commit 86d869a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions resources/prosody-plugins/mod_visitors_component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ local function request_promotion_received(room, from_jid, from_vnode, nick, time
local iq_id = new_id();
sent_iq_cache:set(iq_id, socket.gettime());

local node = jid.node(room.jid);

module:send(st.iq({
type='set', to = req_from, from = module.host, id = iq_id })
:tag('visitors', {
xmlns='jitsi:visitors',
room = string.gsub(room.jid, muc_domain_base, req_from),
room = jid.join(node, muc_domain_prefix..'.'..req_from),
focusjid = focus_jid })
:tag('promotion-response', {
xmlns='jitsi:visitors',
Expand Down Expand Up @@ -282,11 +284,13 @@ local function process_promotion_response(room, id, approved)
local iq_id = new_id();
sent_iq_cache:set(iq_id, socket.gettime());

local node = jid.node(room.jid);

module:send(st.iq({
type='set', to = req_from, from = module.host, id = iq_id })
:tag('visitors', {
xmlns='jitsi:visitors',
room = string.gsub(room.jid, muc_domain_base, req_from),
room = jid.join(node, muc_domain_prefix..'.'..req_from),
focusjid = focus_jid })
:tag('promotion-response', {
xmlns='jitsi:visitors',
Expand Down

0 comments on commit 86d869a

Please sign in to comment.