This commit is contained in:
mathieui 2011-11-06 14:18:45 +01:00
parent 12850ed062
commit fbb465a092
2 changed files with 6 additions and 5 deletions

View file

@ -1505,14 +1505,15 @@ class Core(object):
self.information_win.refresh() self.information_win.refresh()
self.current_tab().input.refresh() self.current_tab().input.refresh()
def disconnect(self, msg=None, reconnect=False): def disconnect(self, msg='', reconnect=False):
""" """
Disconnect from remote server and correctly set the states of all Disconnect from remote server and correctly set the states of all
parts of the client (for example, set the MucTabs as not joined, etc) parts of the client (for example, set the MucTabs as not joined, etc)
""" """
msg = msg or ''
for tab in self.tabs: for tab in self.tabs:
if isinstance(tab, tabs.MucTab): if isinstance(tab, tabs.MucTab) and tab.joined:
muc.leave_groupchat(self.xmpp, tab.name, tab.own_nick, msg) tab.command_part(msg)
roster.empty() roster.empty()
self.save_config() self.save_config()
# Ugly fix thanks to gmail servers # Ugly fix thanks to gmail servers

View file

@ -570,8 +570,8 @@ class MucTab(ChatTab):
msg = None msg = None
if self.joined: if self.joined:
muc.leave_groupchat(self.core.xmpp, self.name, self.own_nick, arg) muc.leave_groupchat(self.core.xmpp, self.name, self.own_nick, arg)
self.joined = False
self.add_message(_("\x195}You left the chatroom\x193}")) self.add_message(_("\x195}You left the chatroom\x193}"))
if self == self.core.current_tab():
self.refresh() self.refresh()
self.core.doupdate() self.core.doupdate()
self.core.disable_private_tabs(self.name) self.core.disable_private_tabs(self.name)