25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

mod_mam: Never store MUC messages in user archives

Even if a groupchat message is tagged with a <store/> hint, don't store
it in a user archive.  The hint should only be honored by the MUC
archive.
This commit is contained in:
Holger Weiss 2017-11-30 22:15:33 +01:00
parent 395b74a89f
commit 0b1a6d7e79

View File

@ -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