# HG changeset patch # User Matthew Wild # Date 1713781580 -3600 # Node ID 1c87c0a7ece6507e4aee1446a3501238f078411e # Parent 3027c2634a4465d1ea79690c97a55f5b17628a40 mod_blocklist: Check JID of mediated MUC invite sender against blocklist This ensures that someone on your blocklist is unable to invite you to MUC rooms. diff -r 3027c2634a44 -r 1c87c0a7ece6 plugins/mod_blocklist.lua --- a/plugins/mod_blocklist.lua Wed Apr 17 16:47:38 2024 +0100 +++ b/plugins/mod_blocklist.lua Mon Apr 22 11:26:20 2024 +0100 @@ -262,7 +262,22 @@ local to, from = attr.to, attr.from; to = to and jid_split(to); if to and from then - return is_blocked(to, from); + if is_blocked(to, from) then + return true; + end + + -- Check mediated MUC inviter + if stanza.name == "message" then + local invite = stanza:find("{http://jabber.org/protocol/muc#user}x/invite"); + if invite then + from = jid_prep(invite.attr.from); + if is_blocked(to, from) then + return true; + end + end + end + + return false; end end