Mercurial > prosody-hg
comparison plugins/mod_blocklist.lua @ 13487:84fa880bf476 0.12
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.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 27 Apr 2024 15:55:23 +0200 |
| parents | 0f335815244f |
| children | ae65f199f408 |
comparison
equal
deleted
inserted
replaced
| 13470:19a9ec94f575 | 13487:84fa880bf476 |
|---|---|
| 320 -- Hook all the events! | 320 -- Hook all the events! |
| 321 local prio_in, prio_out = 100, 100; | 321 local prio_in, prio_out = 100, 100; |
| 322 module:hook("presence/bare", drop_stanza, prio_in); | 322 module:hook("presence/bare", drop_stanza, prio_in); |
| 323 module:hook("presence/full", drop_stanza, prio_in); | 323 module:hook("presence/full", drop_stanza, prio_in); |
| 324 | 324 |
| 325 module:hook("message/bare", bounce_message, prio_in); | 325 if module:get_option_boolean("bounce_blocked_messages", false) then |
| 326 module:hook("message/full", bounce_message, prio_in); | 326 module:hook("message/bare", bounce_message, prio_in); |
| 327 module:hook("message/full", bounce_message, prio_in); | |
| 328 else | |
| 329 module:hook("message/bare", drop_stanza, prio_in); | |
| 330 module:hook("message/full", drop_stanza, prio_in); | |
| 331 end | |
| 327 | 332 |
| 328 module:hook("iq/bare", bounce_iq, prio_in); | 333 module:hook("iq/bare", bounce_iq, prio_in); |
| 329 module:hook("iq/full", bounce_iq, prio_in); | 334 module:hook("iq/full", bounce_iq, prio_in); |
| 330 | 335 |
| 331 module:hook("pre-message/bare", bounce_outgoing, prio_out); | 336 module:hook("pre-message/bare", bounce_outgoing, prio_out); |
