changeset 2094:a1e9ca4cb181

mod_firewall: BOUNCE: Don't bounce error stanzas or iq results
author Matthew Wild <mwild1@gmail.com>
date Wed, 16 Mar 2016 12:42:17 +0000 (2016-03-16)
parents 7b9520479e99
children 3b4a6d255d7a
files mod_firewall/actions.lib.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua	Wed Mar 16 11:46:47 2016 +0000
+++ b/mod_firewall/actions.lib.lua	Wed Mar 16 12:42:17 2016 +0000
@@ -142,7 +142,11 @@
 	else
 		text = "nil";
 	end
-	return route_modify(("error_reply(stanza, %s, %s, %s)"):format(error_type, error, text), nil, true);
+	local route_modify_code, deps = route_modify(("error_reply(stanza, %s, %s, %s)"):format(error_type, error, text), nil, true);
+	deps[#deps+1] = "type";
+	deps[#deps+1] = "name";
+	return [[if type == "error" or (name == "iq" and type == "result") then return true; end -- Don't reply to 'error' stanzas, or iq results
+			]]..route_modify_code, deps;
 end
 
 function action_handlers.REDIRECT(where)