From: Holger Weiss Date: Sun, 15 Apr 2018 23:08:56 +0000 (+0200) Subject: mod_push: Don't notify on stream errors X-Git-Tag: 18.04~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a71e2e4f7a5a833f3984fab3606517c19d5f6d6;p=ejabberd mod_push: Don't notify on stream errors If a pending stream management session is closed with a stream error, this is usually due to the client opening a new stream that conflicts with the old one. Don't generate a push notification in this situation. --- diff --git a/src/mod_push.erl b/src/mod_push.erl index 21bc1375c..1929e5f86 100644 --- a/src/mod_push.erl +++ b/src/mod_push.erl @@ -332,6 +332,8 @@ disable(#jid{luser = LUser, lserver = LServer, lresource = LResource} = JID, %% Hook callbacks. %%-------------------------------------------------------------------- -spec c2s_stanza(c2s_state(), xmpp_element() | xmlel(), term()) -> c2s_state(). +c2s_stanza(State, #stream_error{}, _SendResult) -> + State; c2s_stanza(#{push_enabled := true, mgmt_state := pending} = State, _Pkt, _SendResult) -> notify(State),