diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-01-10 17:40:07 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-01-10 17:40:07 +0100 |
commit | cb96bf4280c5b3e8f7e6142b900e70af46c85cc7 (patch) | |
tree | 13feebf47e9792ca081725c66de854b097c8ea39 /src | |
parent | 8e7b678506bd05fb7ade42d02628ca958fe32ba1 (diff) | |
download | poezio-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/core.py | 7 |
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 |