Comparison

mod_firewall/actions.lib.lua @ 959:6ef334596276

mod_firewall/actions: Add REPLY
author Matthew Wild <mwild1@gmail.com>
date Fri, 05 Apr 2013 18:06:32 +0100
parent 958:843795020701
child 960:d773a51af9b1
comparison
equal deleted inserted replaced
958:843795020701 959:6ef334596276
143 143
144 function action_handlers.COPY(where) 144 function action_handlers.COPY(where)
145 return route_modify("clone(stanza)", where, false); 145 return route_modify("clone(stanza)", where, false);
146 end 146 end
147 147
148 function action_handlers.REPLY(with)
149 return route_modify(("reply(stanza):body(%q)"):format(with));
150 end
151
148 function action_handlers.LOG(string) 152 function action_handlers.LOG(string)
149 local level = string:match("^%[(%a+)%]") or "info"; 153 local level = string:match("^%[(%a+)%]") or "info";
150 string = string:gsub("^%[%a+%] ?", ""); 154 string = string:gsub("^%[%a+%] ?", "");
151 return (("log(%q, %q)"):format(level, string) 155 return (("log(%q, %q)"):format(level, string)
152 :gsub("$top", [["..stanza:top_tag().."]]) 156 :gsub("$top", [["..stanza:top_tag().."]])