summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-10 17:40:07 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-01-10 17:40:07 +0100
commitcb96bf4280c5b3e8f7e6142b900e70af46c85cc7 (patch)
tree13feebf47e9792ca081725c66de854b097c8ea39
parent8e7b678506bd05fb7ade42d02628ca958fe32ba1 (diff)
downloadpoezio-cb96bf4280c5b3e8f7e6142b900e70af46c85cc7.tar.gz
poezio-cb96bf4280c5b3e8f7e6142b900e70af46c85cc7.tar.bz2
poezio-cb96bf4280c5b3e8f7e6142b900e70af46c85cc7.tar.xz
poezio-cb96bf4280c5b3e8f7e6142b900e70af46c85cc7.zip
Handle correctly disconnections
When we are disconnected from the server and we reconnect, do not reopen the MUCs in double.
-rw-r--r--src/core.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py
index 4a124e31..1a022a79 100644
--- a/src/core.py
+++ b/src/core.py
@@ -256,6 +256,9 @@ class Core(object):
"""
When we are disconnected from remote server
"""
+ for tab in self.tabs:
+ if isinstance(tab, tabs.MucTab):
+ tab.get_room().disconnect()
self.information(_("Disconnected from server."))
def on_failed_auth(self, event):
@@ -296,7 +299,9 @@ class Core(object):
nick = config.get('default_nick', '')
if nick == '':
nick = default
- self.open_new_room(jid.bare, nick, False)
+ tab = self.get_tab_by_name(jid.bare)
+ if not tab:
+ self.open_new_room(jid.bare, nick, False)
muc.join_groupchat(self.xmpp, jid.bare, nick)
# if not self.xmpp.anon:
# Todo: SEND VCARD