aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-04-21 01:17:55 +0200
committerKim Alvefur <zash@zash.se>2020-04-21 01:17:55 +0200
commit1056f4bb820479c00c4123f5fea818f45c47f98c (patch)
tree538840109b81f2616ffabb12cd489e85aa946ca1 /plugins
parentbaef0f02e863f093af83003598949c94e9a82218 (diff)
downloadprosody-1056f4bb820479c00c4123f5fea818f45c47f98c.tar.gz
prosody-1056f4bb820479c00c4123f5fea818f45c47f98c.zip
mod_mam: Add more positive hints for storage
Mostly just lifted from mod_csi_simple
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_mam/mod_mam.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index 57f399ae..385a0ad2 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -284,6 +284,18 @@ local function should_store(stanza) --> boolean, reason: string
if stanza:get_child("body") then
return true, "body";
end
+ if stanza:get_child("subject") then
+ -- XXX Who would send a message with a subject but with a body?
+ return true, "subject";
+ end
+ if stanza:get_child("encryption", "urn:xmpp:eme:0") then
+ -- Since we can't know what an encrypted message contains, we assume it's important
+ return true, "encrypted";
+ end
+ if stanza:get_child("x", "jabber:x:conference")
+ or stanza:find("{http://jabber.org/protocol/muc#user}x/invite") then
+ return true, "invite";
+ end
return true, "default";
end