Software /
code /
prosody-modules
Diff
mod_block_strangers/mod_block_strangers.lua @ 1928:252b634b065d
mod_block_strangers: Bounce IQ stanzas (they MUST be replied to)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 23 Oct 2015 16:55:01 +0200 |
parent | 1325:b21236b6b8d8 |
child | 1929:82834df1dea6 |
line wrap: on
line diff
--- a/mod_block_strangers/mod_block_strangers.lua Fri Oct 23 16:52:45 2015 +0200 +++ b/mod_block_strangers/mod_block_strangers.lua Fri Oct 23 16:55:01 2015 +0200 @@ -11,6 +11,9 @@ if to_resource and stanza.attr.type == "groupchat" then return nil; -- Pass through end + if stanza.name == "iq" and ( stanza.attr.type == "get" or stanza.attr.type == "set" ) then + event.origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); + end return true; -- Drop stanza end end