mod_mam: Don't store any groupchat messages
authorKim Alvefur <zash@zash.se>
Thu, 23 Apr 2020 00:55:34 +0200
changeset 10755 4db4bd8a7822
parent 10754 ff087f2d4cb6
child 10756 930f38939f1e
mod_mam: Don't store any groupchat messages The intent was to not store MUC groupchat messages, which are sent from the MUC to local full JIDs, while allowing for potential future account based group chat. However, since this function handles messages in both directions and outgoing MUC messages are sent to the bare room JID, those were stored.
plugins/mod_mam/mod_mam.lua
--- a/plugins/mod_mam/mod_mam.lua	Wed Apr 22 23:36:25 2020 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Thu Apr 23 00:55:34 2020 +0200
@@ -269,6 +269,8 @@
 	if st_type == "error" then
 		st_to_full = (stanza.attr.from or ""):find("/");
 	end
+	-- FIXME pass direction of stanza and use that along with bare/full JID addressing
+	-- for more accurate MUC / type=groupchat check
 
 	if st_type == "headline" then
 		-- Headline messages are ephemeral by definition
@@ -277,7 +279,7 @@
 	if st_type == "error" then
 		return true, "bounce";
 	end
-	if st_type == "groupchat" and st_to_full then
+	if st_type == "groupchat" then
 		-- MUC messages always go to the full JID, usually archived by the MUC
 		return false, "groupchat";
 	end