From d7e330c8eff3bb40a301705bfab7a9510b2c6fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 4 Aug 2021 15:30:29 +0200 Subject: [PATCH] Allow storing non-composing x:events in offline --- src/mod_offline.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mod_offline.erl b/src/mod_offline.erl index c3fda25db..ff95767b6 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -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.