25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +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(). -spec should_archive(message(), binary()) -> boolean().
should_archive(#message{type = error}, _LServer) -> should_archive(#message{type = error}, _LServer) ->
false; false;
should_archive(#message{type = groupchat}, _LServer) ->
false;
should_archive(#message{meta = #{from_offline := true}}, _LServer) -> should_archive(#message{meta = #{from_offline := true}}, _LServer) ->
false; false;
should_archive(#message{body = Body, subject = Subject, should_archive(#message{body = Body, subject = Subject,
@ -590,7 +592,7 @@ should_archive(#message{body = Body, subject = Subject,
true; true;
no_store -> no_store ->
false; false;
none when Type == groupchat; Type == headline -> none when Type == headline ->
false; false;
none -> none ->
xmpp:get_text(Body) /= <<>> orelse xmpp:get_text(Body) /= <<>> orelse