Software /
code /
prosody
Changeset
13481:1c87c0a7ece6
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.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 22 Apr 2024 11:26:20 +0100 |
parents | 13480:3027c2634a44 |
children | 13482:4d697961546d |
files | plugins/mod_blocklist.lua |
diffstat | 1 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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