Skip to content
Snippets Groups Projects
Commit 554b508e authored by nicfit's avatar nicfit
Browse files

[Jim++] Patch for #1603

parent 7126dfb6
No related branches found
No related tags found
No related merge requests found
......@@ -876,13 +876,11 @@ def _process_command(self, message):
return True
elif command == 'leave' or command == 'part' or command == 'close':
# Leave the room and close the tab or window
# FIXME: Sometimes this doesn't actually leave the room. Why?
reason = 'offline'
if len(message_array):
reason = message_array.pop(0)
gajim.connections[self.account].send_gc_status(self.nick, self.room_jid,
show='offline', status=reason)
self.parent_win.remove_tab(self)
self.parent_win.remove_tab(self,reason)
self.clear(self.msg_textview)
return True
elif command == 'ban':
if len(message_array):
......@@ -1030,9 +1028,9 @@ def show_change_nick_input_dialog(self, title, prompt, proposed_nick = None):
gajim.connections[self.account].change_gc_nick(self.room_jid, nick)
self.nick = nick
def shutdown(self):
def shutdown(self, status='offline'):
gajim.connections[self.account].send_gc_status(self.nick, self.room_jid,
show='offline', status='offline')
show='offline', status=status)
# They can already be removed by the destroy function
if self.room_jid in gajim.contacts.get_gc_list(self.account):
gajim.contacts.remove_room(self.account, self.room_jid)
......
......@@ -247,11 +247,14 @@ def set_active_tab(self, jid, acct):
ctrl_page = self.notebook.page_num(ctrl.widget)
self.notebook.set_current_page(ctrl_page)
def remove_tab(self, ctrl):
def remove_tab(self, ctrl,reason=None): # reason is only for gc (offline status message)
# Shutdown the MessageControl
if not ctrl.allow_shutdown():
return
ctrl.shutdown()
if reason is not None: # We are leaving gc with a status message
ctrl.shutdown(reason)
else: # We are leaving gc without status message or it's a chat
ctrl.shutdown()
# Update external state
if gajim.interface.systray_enabled:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment