aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_carbons.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-04-26 20:24:51 +0200
committerKim Alvefur <zash@zash.se>2020-04-26 20:24:51 +0200
commit608f1d1c58ceac633a29036eb1a6b70103d2e0e0 (patch)
tree399b94f98f0a81685c6d9fb85f4992077e25faea /plugins/mod_carbons.lua
parent9e3ef1c01bc14f51a41e5eb413cb05118489bd7f (diff)
downloadprosody-608f1d1c58ceac633a29036eb1a6b70103d2e0e0.tar.gz
prosody-608f1d1c58ceac633a29036eb1a6b70103d2e0e0.zip
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.
Diffstat (limited to 'plugins/mod_carbons.lua')
-rw-r--r--plugins/mod_carbons.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua
index 9befc9cb..c5efce39 100644
--- a/plugins/mod_carbons.lua
+++ b/plugins/mod_carbons.lua
@@ -47,6 +47,12 @@ local function should_copy(stanza, c2s, user_bare)
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