From 8a71e2e4f7a5a833f3984fab3606517c19d5f6d6 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 16 Apr 2018 01:08:56 +0200 Subject: [PATCH] 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. --- src/mod_push.erl | 2 ++ 1 file changed, 2 insertions(+) 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),