Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/nbxmpp
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-03-14 15:52:21 +0300
committerlovetox <philipp@hoerist.com>2020-03-14 15:52:21 +0300
commit546d83b85b4c2f7fae378f0807d0fd7577c4ae65 (patch)
tree51d370898abc42a24967850cee920dc095291de3 /nbxmpp
parentbfa4073870a1e268ab0a38cc3c01ee139266dd56 (diff)
Client: Silence errors after login-successful signal
Diffstat (limited to 'nbxmpp')
-rw-r--r--nbxmpp/client.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nbxmpp/client.py b/nbxmpp/client.py
index 3cd209d..06c57a2 100644
--- a/nbxmpp/client.py
+++ b/nbxmpp/client.py
@@ -415,6 +415,9 @@ class Client(Observable):
self.disconnect()
def _on_parsing_error(self, _dispatcher, _signal_name, error):
+ if self._state == StreamState.DISCONNECTING:
+ # Don't notify about parsing errors if we already ended the stream
+ return
self._disconnect_with_error(StreamError.PARSING, 'parsing-error', error)
def _on_stream_end(self, _dispatcher, _signal_name, error):
@@ -604,6 +607,9 @@ class Client(Observable):
self._stream_authenticated = True
if self._mode.is_login_test:
self.notify('login-successful')
+ # Reset parser because we will receive a new stream header
+ # which will otherwise lead to a parsing error
+ self._dispatcher.reset_parser()
self.disconnect()
return