Handle correctly disconnections
When we are disconnected from the server and we reconnect, do not reopen the MUCs in double.
This commit is contained in:
parent
8e7b678506
commit
cb96bf4280
1 changed files with 6 additions and 1 deletions
|
@ -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,6 +299,8 @@ class Core(object):
|
|||
nick = config.get('default_nick', '')
|
||||
if nick == '':
|
||||
nick = default
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue