From cb96bf4280c5b3e8f7e6142b900e70af46c85cc7 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 10 Jan 2011 17:40:07 +0100 Subject: Handle correctly disconnections When we are disconnected from the server and we reconnect, do not reopen the MUCs in double. --- src/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3