mod_carbons: Carbon anything that has been archived by the current user
authorKim Alvefur <zash@zash.se>
Sun, 26 Apr 2020 20:24:51 +0200
changeset 10786 6b776f80b96e
parent 10785 f7e8d299513f
child 10788 0b0fe73199d2
mod_carbons: Carbon anything that has been archived by the current user This ensures rules in mod_mam apply to some extent. Messages worth archiving are probably worth sending to other clients.
plugins/mod_carbons.lua
--- a/plugins/mod_carbons.lua	Sun Apr 26 20:23:50 2020 +0200
+++ b/plugins/mod_carbons.lua	Sun Apr 26 20:24:51 2020 +0200
@@ -47,6 +47,12 @@
 		return true, "bounce";
 	end
 
+	for archived in stanza:childtags("stanza-id", "urn:xmpp:sid:0") do
+		if archived and archived.attr.by == user_bare then
+			return true, "archived";
+		end
+	end
+
 	return false, "default";
 end