mod_firewall: REPORT TO: Include id in reports
authorMatthew Wild <mwild1@gmail.com>
Tue, 12 Mar 2024 14:31:45 +0000
changeset 5871 3f5644aa5c32
parent 5870 1d1eadff331d
child 5872 bdcb61275afe
mod_firewall: REPORT TO: Include id in reports
mod_firewall/actions.lib.lua
--- a/mod_firewall/actions.lib.lua	Tue Mar 12 14:31:21 2024 +0000
+++ b/mod_firewall/actions.lib.lua	Tue Mar 12 14:31:45 2024 +0000
@@ -267,14 +267,14 @@
 		reason = "urn:xmpp:reporting:abuse";
 	end
 	local code = [[
-		local newstanza = st.stanza("message", { to = %q, from = current_host }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" });
+		local newstanza = st.stanza("message", { to = %q, from = current_host, id = new_short_id() }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" });
 		local tmp_stanza = st.clone(stanza); tmp_stanza.attr.xmlns = "jabber:client"; newstanza:add_child(tmp_stanza):up();
 		newstanza:tag("report", { xmlns = "urn:xmpp:reporting:1", reason = %q })
 		do local text = %q; if text ~= "" then newstanza:text_tag("text", text); end end
 		newstanza:up();
 		core_post_stanza(session, newstanza);
 	]];
-	return code:format(where, reason, text), { "core_post_stanza", "current_host", "st" };
+	return code:format(where, reason, text), { "core_post_stanza", "current_host", "st", "new_short_id" };
 end
 
 return action_handlers;