From 40f292d998650abc1b25b6bbf94b9c4b6174a3a8 Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Tue, 26 Mar 2019 12:13:01 +0100 Subject: Use new slixmpp!12 disconnect/reconnect semantics --- poezio/core/core.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/poezio/core/core.py b/poezio/core/core.py index 6bb19d16..ed977b6d 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -834,14 +834,10 @@ class Core: self.legitimate_disconnect = True for tab in self.get_tabs(tabs.MucTab): tab.command_part(msg) - self.xmpp.disconnect() if reconnect: - # Add a one-time event to reconnect as soon as we are - # effectively disconnected - self.xmpp.add_event_handler( - 'disconnected', - lambda event: self.xmpp.connect(), - disposable=True) + self.xmpp.reconnect(wait=0.0, reason=msg) + else: + self.xmpp.disconnect(reason=msg) def send_message(self, msg: str) -> bool: """ -- cgit v1.2.3