diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2018-04-16 01:08:56 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2018-04-16 01:08:56 +0200 |
commit | 8a71e2e4f7a5a833f3984fab3606517c19d5f6d6 (patch) | |
tree | 57e5072b7c8c5ac0d30d50cbc1414c749f33f34c | |
parent | Merge branch 'muc-self-presence' (diff) |
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.
-rw-r--r-- | src/mod_push.erl | 2 |
1 files changed, 2 insertions, 0 deletions
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), |