[Jim++] Patch for #1603
This commit is contained in:
parent
7126dfb679
commit
554b508e9f
|
@ -876,13 +876,11 @@ class GroupchatControl(ChatControlBase):
|
||||||
return True
|
return True
|
||||||
elif command == 'leave' or command == 'part' or command == 'close':
|
elif command == 'leave' or command == 'part' or command == 'close':
|
||||||
# Leave the room and close the tab or window
|
# Leave the room and close the tab or window
|
||||||
# FIXME: Sometimes this doesn't actually leave the room. Why?
|
|
||||||
reason = 'offline'
|
reason = 'offline'
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
reason = message_array.pop(0)
|
reason = message_array.pop(0)
|
||||||
gajim.connections[self.account].send_gc_status(self.nick, self.room_jid,
|
self.parent_win.remove_tab(self,reason)
|
||||||
show='offline', status=reason)
|
self.clear(self.msg_textview)
|
||||||
self.parent_win.remove_tab(self)
|
|
||||||
return True
|
return True
|
||||||
elif command == 'ban':
|
elif command == 'ban':
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
|
@ -1030,9 +1028,9 @@ class GroupchatControl(ChatControlBase):
|
||||||
gajim.connections[self.account].change_gc_nick(self.room_jid, nick)
|
gajim.connections[self.account].change_gc_nick(self.room_jid, nick)
|
||||||
self.nick = nick
|
self.nick = nick
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self, status='offline'):
|
||||||
gajim.connections[self.account].send_gc_status(self.nick, self.room_jid,
|
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
|
# They can already be removed by the destroy function
|
||||||
if self.room_jid in gajim.contacts.get_gc_list(self.account):
|
if self.room_jid in gajim.contacts.get_gc_list(self.account):
|
||||||
gajim.contacts.remove_room(self.account, self.room_jid)
|
gajim.contacts.remove_room(self.account, self.room_jid)
|
||||||
|
|
|
@ -247,11 +247,14 @@ class MessageWindow:
|
||||||
ctrl_page = self.notebook.page_num(ctrl.widget)
|
ctrl_page = self.notebook.page_num(ctrl.widget)
|
||||||
self.notebook.set_current_page(ctrl_page)
|
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
|
# Shutdown the MessageControl
|
||||||
if not ctrl.allow_shutdown():
|
if not ctrl.allow_shutdown():
|
||||||
return
|
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
|
# Update external state
|
||||||
if gajim.interface.systray_enabled:
|
if gajim.interface.systray_enabled:
|
||||||
|
|
Loading…
Reference in New Issue