From 0b1a6d7e79f9431346dbbf9c651cdbae9ff6f0f9 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 30 Nov 2017 22:15:33 +0100 Subject: mod_mam: Never store MUC messages in user archives Even if a groupchat message is tagged with a hint, don't store it in a user archive. The hint should only be honored by the MUC archive. --- src/mod_mam.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mod_mam.erl b/src/mod_mam.erl index eb839ea19..2f1a16afa 100644 --- a/src/mod_mam.erl +++ b/src/mod_mam.erl @@ -577,6 +577,8 @@ process_iq(LServer, #iq{from = #jid{luser = LUser}, lang = Lang, -spec should_archive(message(), binary()) -> boolean(). should_archive(#message{type = error}, _LServer) -> false; +should_archive(#message{type = groupchat}, _LServer) -> + false; should_archive(#message{meta = #{from_offline := true}}, _LServer) -> false; should_archive(#message{body = Body, subject = Subject, @@ -590,7 +592,7 @@ should_archive(#message{body = Body, subject = Subject, true; no_store -> false; - none when Type == groupchat; Type == headline -> + none when Type == headline -> false; none -> xmpp:get_text(Body) /= <<>> orelse -- cgit v1.2.3