fix: Generates correct join error for lobby. (#10673)

* fix: Drops wrong x tag.

* fix: Generates correct join error for lobby.

We were adding lobbyroom element in a location that violates the rfc and xmpp errors.
We add now and the correct one and will drop the wrong node when all clients are updated.
https://datatracker.ietf.org/doc/html/draft-ietf-xmpp-3920bis#section-8.3.2

* squash: Add todo comment.

* squash: Updates namespace.
This commit is contained in:
Дамян Минков 2021-12-22 14:40:20 -06:00 committed by GitHub
parent a436a889a9
commit b084aae212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -380,10 +380,13 @@ process_host_module(main_muc_component_config, function(host_module, host)
local invitee = event.stanza.attr.from;
local affiliation = room:get_affiliation(invitee);
if not affiliation or affiliation == 'none' then
local reply = st.error_reply(stanza, 'auth', 'registration-required'):up();
local reply = st.error_reply(stanza, 'auth', 'registration-required');
reply.tags[1].attr.code = '407';
reply:tag('x', {xmlns = MUC_NS}):up();
reply:tag('lobbyroom'):text(room._data.lobbyroom);
reply:tag('lobbyroom', { xmlns = 'http://jitsi.org/jitmeet' }):text(room._data.lobbyroom):up():up();
-- TODO: Drop this tag at some point (when all mobile clients and jigasi are updated), as this violates the rfc
reply:tag('lobbyroom'):text(room._data.lobbyroom):up();
event.origin.send(reply:tag('x', {xmlns = MUC_NS}));
return true;
end