mod_blocklist: Drop blocked messages without error, option to restore compliant behavior 0.12
authorKim Alvefur <zash@zash.se>
Sat, 27 Apr 2024 15:55:23 +0200
branch0.12
changeset 13491 84fa880bf476
parent 13474 19a9ec94f575
child 13492 b2b090181270
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.
plugins/mod_blocklist.lua
--- a/plugins/mod_blocklist.lua	Thu Apr 04 19:39:33 2024 +0200
+++ b/plugins/mod_blocklist.lua	Sat Apr 27 15:55:23 2024 +0200
@@ -322,8 +322,13 @@
 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);