diff mod_firewall/actions.lib.lua @ 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
parents de6b95d5e01b
children f2ee508315e1
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)