send gone chatstate to every tab when closing a window with many tabs
This commit is contained in:
parent
b8de6a0275
commit
f094f65bd2
10
src/chat.py
10
src/chat.py
|
@ -141,13 +141,17 @@ class Chat:
|
|||
def on_window_destroy(self, widget, kind): #kind is 'chats' or 'gc'
|
||||
#clean self.plugin.windows[self.account][kind]
|
||||
for jid in self.xmls:
|
||||
windows = self.plugin.windows[self.account][kind]
|
||||
if kind == 'chats':
|
||||
# send 'gone' chatstate to every tabbed chat tab
|
||||
windows[jid].send_chatstate('gone')
|
||||
if self.plugin.systray_enabled and self.nb_unread[jid] > 0:
|
||||
self.plugin.systray.remove_jid(jid, self.account)
|
||||
del self.plugin.windows[self.account][kind][jid]
|
||||
del windows[jid]
|
||||
if self.print_time_timeout_id.has_key(jid):
|
||||
gobject.source_remove(self.print_time_timeout_id[jid])
|
||||
if self.plugin.windows[self.account][kind].has_key('tabbed'):
|
||||
del self.plugin.windows[self.account][kind]['tabbed']
|
||||
if windows.has_key('tabbed'):
|
||||
del windows['tabbed']
|
||||
|
||||
def get_active_jid(self):
|
||||
notebook = self.notebook
|
||||
|
|
|
@ -209,8 +209,6 @@ class TabbedChatWindow(chat.Chat):
|
|||
gajim.config.set('chat-height', height)
|
||||
|
||||
def on_tabbed_chat_window_destroy(self, widget):
|
||||
# on window destroy, send 'gone' chatstate
|
||||
self.send_chatstate('gone') # FIXME: loop to each tab and send that
|
||||
#clean self.plugin.windows[self.account]['chats']
|
||||
chat.Chat.on_window_destroy(self, widget, 'chats')
|
||||
|
||||
|
@ -360,8 +358,10 @@ class TabbedChatWindow(chat.Chat):
|
|||
self.send_chatstate('composing')
|
||||
|
||||
def send_chatstate(self, state):
|
||||
''' sends our chatstate to the current tab '''
|
||||
# please read jep-85 to get an idea of this
|
||||
# we keep track of jep85 support by the peer by three extra states: None, -1 and 'ask'
|
||||
# we keep track of jep85 support by the peer by three extra states:
|
||||
# None, -1 and 'ask'
|
||||
# None if no info about peer
|
||||
# -1 if peer does not support jep85
|
||||
# 'ask' if we sent 'active' chatstate and are waiting for reply
|
||||
|
|
Loading…
Reference in New Issue