]> granicus.if.org Git - ejabberd/commitdiff
mod_push: Don't notify on stream errors
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 15 Apr 2018 23:08:56 +0000 (01:08 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 15 Apr 2018 23:08:56 +0000 (01:08 +0200)
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

index 21bc1375cbf12847ca5cf90ee2a2195d33574c5f..1929e5f8685cacb38ec8cadebf97e7a7c275577a 100644 (file)
@@ -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),