aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2024-04-22 11:26:20 +0100
committerMatthew Wild <mwild1@gmail.com>2024-04-22 11:26:20 +0100
commitf94d5d2f7f93ee855e407b793e631944322cc7c1 (patch)
tree8aa83f8dc0a8efb69f55d80411ed3ddd2f944386
parentd1022fe0c475ebbe3ea3bcd610294ef4ff473a70 (diff)
downloadprosody-f94d5d2f7f93ee855e407b793e631944322cc7c1.tar.gz
prosody-f94d5d2f7f93ee855e407b793e631944322cc7c1.zip
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.
-rw-r--r--plugins/mod_blocklist.lua17
1 files changed, 16 insertions, 1 deletions
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