Changeset

10738:19ffb2ebf114

mod_mam: Add more positive hints for storage Mostly just lifted from mod_csi_simple
author Kim Alvefur <zash@zash.se>
date Tue, 21 Apr 2020 01:17:55 +0200
parents 10737:b2ede421adeb
children 10739:50f0a4d83731
files plugins/mod_mam/mod_mam.lua
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_mam/mod_mam.lua	Tue Apr 21 01:01:25 2020 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Tue Apr 21 01:17:55 2020 +0200
@@ -284,6 +284,18 @@
 	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