24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-08 21:43:07 +02:00

Do not store mucsub wrapped messages with no-store hint in offline storage

We already don't store those messages in mam and we don't store messages
that aren't wrapped with that hint in offline, so it make sense to extend
it also to mucsub messages.
This commit is contained in:
Paweł Chmielowski 2019-05-06 19:17:30 +02:00
parent 3d434cfcef
commit 83b790c7c9

View File

@ -405,6 +405,12 @@ need_to_store(_LServer, #message{type = error}) -> false;
need_to_store(LServer, #message{type = Type} = Packet) -> need_to_store(LServer, #message{type = Type} = Packet) ->
case xmpp:has_subtag(Packet, #offline{}) of case xmpp:has_subtag(Packet, #offline{}) of
false -> false ->
case misc:unwrap_mucsub_message(Packet) of
#message{type = groupchat} = Msg ->
need_to_store(LServer, Msg#message{type = chat});
#message{} = Msg ->
need_to_store(LServer, Msg);
_ ->
case check_store_hint(Packet) of case check_store_hint(Packet) of
store -> store ->
true; true;
@ -431,6 +437,7 @@ need_to_store(LServer, #message{type = Type} = Packet) ->
{_, unless_chat_state} -> {_, unless_chat_state} ->
not misc:is_standalone_chat_state(Packet) not misc:is_standalone_chat_state(Packet)
end end
end
end; end;
true -> true ->
false false