From f94d5d2f7f93ee855e407b793e631944322cc7c1 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 22 Apr 2024 11:26:20 +0100 Subject: 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. --- plugins/mod_blocklist.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index 3a621753..99773b3a 100644 --- a/plugins/mod_blocklist.lua +++ b/plugins/mod_blocklist.lua @@ -262,7 +262,22 @@ local function drop_stanza(event) 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 -- cgit v1.2.3