summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Buquet <pep@bouah.net>2020-03-28 22:11:34 +0100
committerMaxime Buquet <pep@bouah.net>2020-03-28 22:11:34 +0100
commite9a87a0b7791283322cc06d5a5d3c52f933d536b (patch)
tree43c777033211d1497b643ffbd84c2072a73e5c8c
parent115c234527217bef1adf9e2ce611971d59905d57 (diff)
parentd85efec7a245fee045fdd095221ccfa9bd43b58f (diff)
downloadslixmpp-e9a87a0b7791283322cc06d5a5d3c52f933d536b.tar.gz
slixmpp-e9a87a0b7791283322cc06d5a5d3c52f933d536b.tar.bz2
slixmpp-e9a87a0b7791283322cc06d5a5d3c52f933d536b.tar.xz
slixmpp-e9a87a0b7791283322cc06d5a5d3c52f933d536b.zip
Merge branch 'master' into 'master'
reconnect: fix callback when not currently connected See merge request poezio/slixmpp!32
-rw-r--r--slixmpp/xmlstream/xmlstream.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index dbf515ca..c3c82a37 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -494,6 +494,8 @@ class XMLStream(asyncio.BaseProtocol):
self.send_raw(self.stream_footer)
self.schedule('Disconnect wait', wait,
self.abort, repeat=False)
+ else:
+ self.event("disconnected", reason)
def abort(self):
"""
@@ -512,8 +514,8 @@ class XMLStream(asyncio.BaseProtocol):
when the server acknowledgement is received), call connect()
"""
log.debug("reconnecting...")
- self.disconnect(wait, reason)
self.add_event_handler('disconnected', lambda event: self.connect(), disposable=True)
+ self.disconnect(wait, reason)
def configure_socket(self):
"""Set timeout and other options for self.socket.