comparison mod_firewall/actions.lib.lua @ 1303:8a3f3f485675

mod_firewall: Produce code with nicer indentation
author Florian Zeitz <florob@babelmonkeys.de>
date Sun, 16 Feb 2014 17:17:23 +0100
parents f0108ec2b016
children 7dbde05b48a9
comparison
equal deleted inserted replaced
1302:e556219cb43d 1303:8a3f3f485675
121 local reroute, deps = "session.send(newstanza)", { "st" }; 121 local reroute, deps = "session.send(newstanza)", { "st" };
122 if to then 122 if to then
123 reroute = ("newstanza.attr.to = %q; core_post_stanza(session, newstanza)"):format(to); 123 reroute = ("newstanza.attr.to = %q; core_post_stanza(session, newstanza)"):format(to);
124 deps[#deps+1] = "core_post_stanza"; 124 deps[#deps+1] = "core_post_stanza";
125 end 125 end
126 return ([[local newstanza = st.%s; %s; %s ]]) 126 return ([[local newstanza = st.%s; %s;%s]])
127 :format(make_new, reroute, drop and "return true;" or ""), deps; 127 :format(make_new, reroute, drop and " return true;" or ""), deps;
128 end 128 end
129 129
130 function action_handlers.BOUNCE(with) 130 function action_handlers.BOUNCE(with)
131 local error = with and with:match("^%S+") or "service-unavailable"; 131 local error = with and with:match("^%S+") or "service-unavailable";
132 local error_type = error:match(":(%S+)"); 132 local error_type = error:match(":(%S+)");