mod_firewall/actions.lib.lua
changeset 2545 76f03d514b13
parent 2535 9d2bfff515b8
child 2546 cca9de97526b
--- a/mod_firewall/actions.lib.lua	Tue Feb 21 10:39:00 2017 +0000
+++ b/mod_firewall/actions.lib.lua	Tue Feb 21 13:37:44 2017 +0000
@@ -155,6 +155,15 @@
 	return route_modify(("reply(stanza):body(%q)"):format(with));
 end
 
+function action_handlers.FORWARD(where)
+	local code = [[
+		local newstanza = st.stanza("message", { to = %q }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" });
+		local tmp_stanza = st.clone(stanza); tmp_stanza.attr.xmlns = "jabber:client"; newstanza:add_child(tmp_stanza);
+		core_post_stanza(session, newstanza);
+	]];
+	return code:format(where);
+end
+
 function action_handlers.LOG(string)
 	local level = string:match("^%[(%a+)%]") or "info";
 	string = string:gsub("^%[%a+%] ?", "");