Changeset

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
parents 1927:439711709d29
children 1929:82834df1dea6
files mod_block_strangers/mod_block_strangers.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
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