mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(visitors): Adds an option to ignore certain domains. (#13174)
* feat(visitors): Adds an option to ignore certain domains. Can ignore domains (used for jibri and transcriber) to avoid propagating them to visitor nodes. * squash: Drop filtering messages.
This commit is contained in:
@@ -40,6 +40,10 @@ if main_muc_component_config == nil then
|
||||
return ;
|
||||
end
|
||||
|
||||
-- A list of domains which to be ignored for visitors. For occupants using those domain we do not propagate them
|
||||
-- to visitor nodes and we do not update them with presence changes
|
||||
local ignore_list = module:get_option_set('visitors_ignore_list', {});
|
||||
|
||||
-- Advertise the component for discovery via disco#items
|
||||
module:add_identity('component', 'visitors', 'visitors.'..module.host);
|
||||
|
||||
@@ -150,8 +154,9 @@ process_host_module(main_muc_component_config, function(host_module, host)
|
||||
host_module:hook('muc-occupant-pre-change', function (event)
|
||||
local room, stanza, occupant = event.room, event.stanza, event.dest_occupant;
|
||||
|
||||
-- filter focus
|
||||
if is_admin(stanza.attr.from) or visitors_nodes[room.jid] == nil then
|
||||
-- filter focus and configured domains (used for jibri and transcribers)
|
||||
if is_admin(stanza.attr.from) or visitors_nodes[room.jid] == nil
|
||||
or ignore_list:contains(jid.host(occupant.bare_jid)) then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -170,7 +175,9 @@ process_host_module(main_muc_component_config, function(host_module, host)
|
||||
host_module:hook('muc-occupant-left', function (event)
|
||||
local room, stanza, occupant = event.room, event.stanza, event.occupant;
|
||||
|
||||
if is_admin(occupant.bare_jid) or visitors_nodes[room.jid] == nil or visitors_nodes[room.jid].nodes == nil then
|
||||
-- ignore configured domains (jibri and transcribers)
|
||||
if is_admin(occupant.bare_jid) or visitors_nodes[room.jid] == nil or visitors_nodes[room.jid].nodes == nil
|
||||
or ignore_list:contains(jid.host(occupant.bare_jid)) then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -198,8 +205,9 @@ process_host_module(main_muc_component_config, function(host_module, host)
|
||||
host_module:hook('muc-occupant-joined', function (event)
|
||||
local room, stanza, occupant = event.room, event.stanza, event.occupant;
|
||||
|
||||
-- filter focus
|
||||
if is_admin(stanza.attr.from) or visitors_nodes[room.jid] == nil then
|
||||
-- filter focus, ignore configured domains (jibri and transcribers)
|
||||
if is_admin(stanza.attr.from) or visitors_nodes[room.jid] == nil
|
||||
or ignore_list:contains(jid.host(occupant.bare_jid)) then
|
||||
return;
|
||||
end
|
||||
|
||||
@@ -217,7 +225,8 @@ process_host_module(main_muc_component_config, function(host_module, host)
|
||||
host_module:hook("muc-occupant-groupchat", function(event)
|
||||
local room, stanza, occupant = event.room, event.stanza, event.occupant;
|
||||
|
||||
if not visitors_nodes[room.jid] then
|
||||
-- filter sending messages from transcribers/jibris to visitors
|
||||
if not visitors_nodes[room.jid] or ignore_list:contains(jid.host(occupant.bare_jid)) then
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user