changeset 5915:db5128d1a16c

mod_report_forward: Fix traceback when reporting a specific message (thanks singpolyma)
author Matthew Wild <mwild1@gmail.com>
date Thu, 30 May 2024 17:55:07 +0100
parents d3610fb965d6
children 1927d4d27a26
files mod_report_forward/mod_report_forward.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_report_forward/mod_report_forward.lua	Fri May 24 18:30:47 2024 -0500
+++ b/mod_report_forward/mod_report_forward.lua	Thu May 30 17:55:07 2024 +0100
@@ -95,7 +95,7 @@
 	local report = st.clone(event.report);
 	report:text_tag("jid", reported_jid, { xmlns = "urn:xmpp:jid:0" });
 
-	local reported_message_id = report:get_child_with_attr(
+	local reported_message_el = report:get_child_with_attr(
 		"stanza-id",
 		"urn:xmpp:sid:0",
 		"by",
@@ -104,8 +104,8 @@
 	);
 
 	local reported_message, reported_message_time, reported_message_with;
-	if reported_message_id then
-		reported_message, reported_message_time, reported_message_with = archive:get(reporter_username, reported_message_id);
+	if reported_message_el then
+		reported_message, reported_message_time, reported_message_with = archive:get(reporter_username, reported_message_el.attr.id);
 		if jid.bare(reported_message_with) ~= event.jid then
 			reported_message = nil;
 		end