mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01: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:
parent
3d434cfcef
commit
83b790c7c9
@ -405,31 +405,38 @@ 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 check_store_hint(Packet) of
|
case misc:unwrap_mucsub_message(Packet) of
|
||||||
store ->
|
#message{type = groupchat} = Msg ->
|
||||||
true;
|
need_to_store(LServer, Msg#message{type = chat});
|
||||||
no_store ->
|
#message{} = Msg ->
|
||||||
false;
|
need_to_store(LServer, Msg);
|
||||||
none ->
|
_ ->
|
||||||
Store = case Type of
|
case check_store_hint(Packet) of
|
||||||
groupchat ->
|
store ->
|
||||||
gen_mod:get_module_opt(
|
|
||||||
LServer, ?MODULE, store_groupchat);
|
|
||||||
headline ->
|
|
||||||
false;
|
|
||||||
_ ->
|
|
||||||
true
|
|
||||||
end,
|
|
||||||
case {Store, gen_mod:get_module_opt(
|
|
||||||
LServer, ?MODULE, store_empty_body)} of
|
|
||||||
{false, _} ->
|
|
||||||
false;
|
|
||||||
{_, true} ->
|
|
||||||
true;
|
true;
|
||||||
{_, false} ->
|
no_store ->
|
||||||
Packet#message.body /= [];
|
false;
|
||||||
{_, unless_chat_state} ->
|
none ->
|
||||||
not misc:is_standalone_chat_state(Packet)
|
Store = case Type of
|
||||||
|
groupchat ->
|
||||||
|
gen_mod:get_module_opt(
|
||||||
|
LServer, ?MODULE, store_groupchat);
|
||||||
|
headline ->
|
||||||
|
false;
|
||||||
|
_ ->
|
||||||
|
true
|
||||||
|
end,
|
||||||
|
case {Store, gen_mod:get_module_opt(
|
||||||
|
LServer, ?MODULE, store_empty_body)} of
|
||||||
|
{false, _} ->
|
||||||
|
false;
|
||||||
|
{_, true} ->
|
||||||
|
true;
|
||||||
|
{_, false} ->
|
||||||
|
Packet#message.body /= [];
|
||||||
|
{_, unless_chat_state} ->
|
||||||
|
not misc:is_standalone_chat_state(Packet)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
true ->
|
true ->
|
||||||
|
Loading…
Reference in New Issue
Block a user