Allow storing non-composing x:events in offline

This commit is contained in:
Paweł Chmielowski 2021-08-04 15:30:29 +02:00
parent 99ffd9bb95
commit d7e330c8ef
1 changed files with 10 additions and 0 deletions

View File

@ -572,6 +572,16 @@ check_event(#message{from = From, to = To, id = ID, type = Type} = Msg) ->
sub_els = [#xevent{id = ID, offline = true}]},
ejabberd_router:route(NewMsg),
true;
% Don't store composing events
#xevent{id = V, composing = true} when V /= undefined ->
false;
% Nor composing stopped events
#xevent{id = V, composing = false, delivered = false,
displayed = false, offline = false} when V /= undefined ->
false;
% But store other received notifications
#xevent{id = V} when V /= undefined ->
true;
_ ->
false
end.