Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(visitors): Deny access when room is not live and there is a list of participants.

damenchod1328d68f225
diff --git a/resources/prosody-plugins/mod_visitors_component.lua b/resources/prosody-plugins/mod_visitors_component.lua
index 1a29fc72ee..ac9ae2f912 100644
--- a/resources/prosody-plugins/mod_visitors_component.lua
+++ b/resources/prosody-plugins/mod_visitors_component.lua
@@ -472,8 +472,10 @@ process_host_module(muc_domain_prefix..'.'..muc_domain_base, function(host_modul
join:tag('password', { xmlns = MUC_NS }):text(room:get_password());
end
- -- we skip any checks when auto-allow is enabled
- if (auto_allow_promotion or get_visitors_room_metadata(room).autoPromote)
+ local is_live = get_visitors_room_metadata(room).live;
+
+ -- we skip any checks when auto-allow is enabled and room is live
+ if (auto_allow_promotion or get_visitors_room_metadata(room).autoPromote and (is_live or is_live == nil))
or ignore_list:contains(jid.host(stanza.attr.from)) -- jibri or other domains to ignore
or is_sip_jigasi(stanza)
or is_sip_jibri_join(stanza)
@@ -515,6 +517,17 @@ process_host_module(muc_domain_prefix..'.'..muc_domain_base, function(host_modul
:tag('no-main-participants', { xmlns = 'jitsi:visitors' }));
return true;
end
+ elseif is_live == false
+ and room._data.mainMeetingParticipants
+ and #room._data.mainMeetingParticipants > 0 then
+ -- This is non jaas room which is not live and has a list of participants
+ -- allowed to participate in the main room, but this participant is not one of them
+ session.log('warn',
+ 'Deny user join in the main not live meeting, not in the list of main participants');
+ session.send(st.error_reply(
+ stanza, 'cancel', 'not-allowed', 'Tried to join the main (not live) room')
+ :tag('not-live-room', { xmlns = 'jitsi:visitors' }));
+ return true;
end
end, 7); -- after muc_meeting_id, the logic for not joining before jicofo