diff options
author | Kim Alvefur <zash@zash.se> | 2020-04-23 00:55:34 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-04-23 00:55:34 +0200 |
commit | 9644332df92d2c2d589744377cc685a405213143 (patch) | |
tree | 74e41e0fe036293c0ddbf10872a39fc6af6808c8 /plugins | |
parent | f4ef7e458730d5913fe6760892f713657b8be007 (diff) | |
download | prosody-9644332df92d2c2d589744377cc685a405213143.tar.gz prosody-9644332df92d2c2d589744377cc685a405213143.zip |
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.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_mam/mod_mam.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index a9d389f5..65859afd 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -269,6 +269,8 @@ local function should_store(stanza) --> boolean, reason: string 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 @@ local function should_store(stanza) --> boolean, reason: string 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 |