summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEijebong <eijebong@bananium.fr>2017-04-11 13:42:51 +0200
committermathieui <mathieui@mathieui.net>2017-06-27 20:41:03 +0200
commita07c87bcbe00b048c682f1ce20fade166a7750ac (patch)
tree848c76b22c1257a693470addbb6063164cfc3b6a
parentbc08858b8ac7072cff622fa6c3b0f63dcbe9e548 (diff)
downloadpoezio-a07c87bcbe00b048c682f1ce20fade166a7750ac.tar.gz
poezio-a07c87bcbe00b048c682f1ce20fade166a7750ac.tar.bz2
poezio-a07c87bcbe00b048c682f1ce20fade166a7750ac.tar.xz
poezio-a07c87bcbe00b048c682f1ce20fade166a7750ac.zip
Fix the resource duplication when reconnecting while auto_reconnect is true.
The problem is that core.legitimate_disconnect is set to True in the on_connecting callback which is called before the session_end for some reasons. on_connecting sets core.legitimate_disconnect back to False so session_end thinks we've been disconnected and connects automagically adding a resource and thus duplicating everything. Moving the reset of legitimate_disconnect to the on_connected callback fixes the problem.
-rw-r--r--poezio/core/core.py1
-rw-r--r--poezio/core/handlers.py5
2 files changed, 0 insertions, 6 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 35d50b65..be257c40 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -199,7 +199,6 @@ class Core(object):
self.key_func.update(key_func)
# Add handlers
- self.xmpp.add_event_handler('connecting', self.handler.on_connecting)
self.xmpp.add_event_handler('connected', self.handler.on_connected)
self.xmpp.add_event_handler('connection_failed', self.handler.on_failed_connection)
self.xmpp.add_event_handler('disconnected', self.handler.on_disconnected)
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index 156f6b57..1e6e08ee 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -989,11 +989,6 @@ class HandlerCore:
Remote host responded, but we are not yet authenticated
"""
self.core.information("Connected to server.", 'Info')
-
- def on_connecting(self, event):
- """
- Just before we try to connect to the server
- """
self.core.legitimate_disconnect = False
def on_session_start(self, event):