# HG changeset patch # User Jonas Schäfer # Date 1677069303 -3600 # Node ID 4791e0412ff31791335dae915260259ded059bf1 # Parent 432587ad1642c3152bcd3986bac64e121ca41390 mod_muc_rtbl: ignore blocklist for affiliated users for messages Just like we ignore the blocklist for join attempts from affiliated users, we also do that now on messages. diff -r 432587ad1642 -r 4791e0412ff3 mod_muc_rtbl/mod_muc_rtbl.lua --- a/mod_muc_rtbl/mod_muc_rtbl.lua Wed Feb 22 13:33:16 2023 +0100 +++ b/mod_muc_rtbl/mod_muc_rtbl.lua Wed Feb 22 13:35:03 2023 +0100 @@ -129,6 +129,12 @@ end); module:hook("muc-occupant-groupchat", function(event) + local affiliation = event.room:get_affiliation(event.occupant.bare_jid); + if affiliation and affiliation ~= "none" then + -- Skip check for affiliated users + return; + end + local bare_hash, host_hash = update_hashes(event.occupant); if banned_hashes[bare_hash] or banned_hashes[host_hash] then module:log("debug", "Blocked message from user <%s> to room <%s> due to RTBL match", event.stanza.attr.from, event.stanza.attr.to); @@ -140,6 +146,12 @@ module:hook("muc-private-message", function(event) local occupant = event.room:get_occupant_by_nick(event.stanza.attr.from); + local affiliation = event.room:get_affiliation(event.occupant.bare_jid); + if affiliation and affiliation ~= "none" then + -- Skip check for affiliated users + return; + end + local bare_hash, host_hash = update_hashes(occupant); if banned_hashes[bare_hash] or banned_hashes[host_hash] then module:log("debug", "Blocked private message from user <%s> from room <%s> due to RTBL match", occupant.bare_jid, event.stanza.attr.to);