diff options
author | Kim Alvefur <zash@zash.se> | 2024-04-27 15:55:23 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2024-04-27 15:55:23 +0200 |
commit | 4414f8402faea1b1c059487af692da7d432c68bc (patch) | |
tree | 4c0e3e3318ab8005c04d03fa206642aa15cb6d9e /plugins | |
parent | ec3655ced63719cc1cb13ee4c5f9bff8a534675e (diff) | |
download | prosody-4414f8402faea1b1c059487af692da7d432c68bc.tar.gz prosody-4414f8402faea1b1c059487af692da7d432c68bc.zip |
mod_blocklist: Drop blocked messages without error, option to restore compliant behavior
From XEP-0191:
> For message stanzas, the server SHOULD return an error, which SHOULD
> be <service-unavailable/>.
Following this may leak to a blocked JID that they have been blocked,
which seems contrary to the goal of pretending to be perpetually
offline.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_blocklist.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index dad06b62..6b8ce16c 100644 --- a/plugins/mod_blocklist.lua +++ b/plugins/mod_blocklist.lua @@ -322,8 +322,13 @@ local prio_in, prio_out = 100, 100; module:hook("presence/bare", drop_stanza, prio_in); module:hook("presence/full", drop_stanza, prio_in); -module:hook("message/bare", bounce_message, prio_in); -module:hook("message/full", bounce_message, prio_in); +if module:get_option_boolean("bounce_blocked_messages", false) then + module:hook("message/bare", bounce_message, prio_in); + module:hook("message/full", bounce_message, prio_in); +else + module:hook("message/bare", drop_stanza, prio_in); + module:hook("message/full", drop_stanza, prio_in); +end module:hook("iq/bare", bounce_iq, prio_in); module:hook("iq/full", bounce_iq, prio_in); |