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: Ignores list of domains when checking for visitors and promotion. #13539

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Changes from all commits
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
6 changes: 5 additions & 1 deletion resources/prosody-plugins/mod_visitors_component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if not muc_domain_base then
return;
end

-- A list of domains which to be ignored for visitors. The config is set under the main virtual host
local ignore_list = module:context(muc_domain_base):get_option_set('visitors_ignore_list', {});

local auto_allow_promotion = module:get_option_boolean('auto_allow_visitor_promotion', false);

local function is_admin(jid)
Expand Down Expand Up @@ -202,7 +205,8 @@ process_host_module(muc_domain_prefix..'.'..muc_domain_base, function(host_modul

if visitors_promotion_map[room.jid] then
-- now let's check for jid
if visitors_promotion_map[room.jid][jid.node(stanza.attr.from)] then
if visitors_promotion_map[room.jid][jid.node(stanza.attr.from)] -- promotion was approved
or ignore_list:contains(jid.host(stanza.attr.from)) then -- jibri or other domains to ignore
-- allow join
return;
end
Expand Down