Changeset

5891:3f5644aa5c32

mod_firewall: REPORT TO: Include id in reports
author Matthew Wild <mwild1@gmail.com>
date Tue, 12 Mar 2024 14:31:45 +0000
parents 5890:1d1eadff331d
children 5892:bdcb61275afe
files mod_firewall/actions.lib.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;