mod_firewall/actions.lib.lua
changeset 2546 cca9de97526b
parent 2545 76f03d514b13
child 2555 9392f45b0364
equal deleted inserted replaced
2545:76f03d514b13 2546:cca9de97526b
   155 	return route_modify(("reply(stanza):body(%q)"):format(with));
   155 	return route_modify(("reply(stanza):body(%q)"):format(with));
   156 end
   156 end
   157 
   157 
   158 function action_handlers.FORWARD(where)
   158 function action_handlers.FORWARD(where)
   159 	local code = [[
   159 	local code = [[
   160 		local newstanza = st.stanza("message", { to = %q }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" });
   160 		local newstanza = st.stanza("message", { to = %q, from = session.host }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" });
   161 		local tmp_stanza = st.clone(stanza); tmp_stanza.attr.xmlns = "jabber:client"; newstanza:add_child(tmp_stanza);
   161 		local tmp_stanza = st.clone(stanza); tmp_stanza.attr.xmlns = "jabber:client"; newstanza:add_child(tmp_stanza);
   162 		core_post_stanza(session, newstanza);
   162 		core_post_stanza(session, newstanza);
   163 	]];
   163 	]];
   164 	return code:format(where);
   164 	return code:format(where), { "core_post_stanza" };
   165 end
   165 end
   166 
   166 
   167 function action_handlers.LOG(string)
   167 function action_handlers.LOG(string)
   168 	local level = string:match("^%[(%a+)%]") or "info";
   168 	local level = string:match("^%[(%a+)%]") or "info";
   169 	string = string:gsub("^%[%a+%] ?", "");
   169 	string = string:gsub("^%[%a+%] ?", "");