diff plugins/mod_carbons.lua @ 14070:d7f2ffc25273 13.0

mod_carbons: Fix some carbons decision-making bugs (fixes #1861) This was introduced when refactoring into an event in commit 063ce658c181 (released in 0.12.0). Known policies to be affected: - Copying of outgoing MUC PMs (#1861) - Copying of archived stanzas (if not copied by other rules)
author Matthew Wild <mwild1@gmail.com>
date Wed, 11 Feb 2026 11:38:55 +0000
parents 74b9e05af71e
children 54b30a374953 d79ef7a38fe8
line wrap: on
line diff
--- a/plugins/mod_carbons.lua	Mon Feb 09 18:30:57 2026 +0100
+++ b/plugins/mod_carbons.lua	Wed Feb 11 11:38:55 2026 +0000
@@ -70,7 +70,7 @@
 end
 
 module:hook("carbons-should-copy", function (event)
-	local should, why = should_copy(event.stanza);
+	local should, why = should_copy(event.stanza, event.from_c2s, event.user_bare);
 	event.reason = why;
 	return should;
 end, -1)
@@ -107,7 +107,12 @@
 		return -- No use in sending carbons to an offline user
 	end
 
-	local event_payload = { stanza = stanza; session = origin };
+	local event_payload = {
+		stanza = stanza;
+		session = origin;
+		from_c2s = c2s;
+		user_bare = bare_jid;
+	};
 	local should = module:fire_event("carbons-should-copy", event_payload);
 	local why = event_payload.reason;