fix jep0070 accidental reversion
This commit is contained in:
parent
8e7ad66056
commit
73a4bf97e8
11
src/chat.py
11
src/chat.py
|
@ -62,6 +62,7 @@ class Chat:
|
||||||
self.names = {} # what is printed in the tab (eg. user.name)
|
self.names = {} # what is printed in the tab (eg. user.name)
|
||||||
self.childs = {} # holds the contents for every tab (VBox)
|
self.childs = {} # holds the contents for every tab (VBox)
|
||||||
self.popup_is_shown = False # is a context menu shown or not?
|
self.popup_is_shown = False # is a context menu shown or not?
|
||||||
|
self.how_many_switch_to = 0 # how many switch to menuitems we have added
|
||||||
|
|
||||||
# the following vars are used to keep history of user's messages
|
# the following vars are used to keep history of user's messages
|
||||||
self.sent_history = {}
|
self.sent_history = {}
|
||||||
|
@ -233,14 +234,7 @@ class Chat:
|
||||||
childs[5].set_no_show_all(True)
|
childs[5].set_no_show_all(True)
|
||||||
|
|
||||||
for child in childs[6:]: # start looping after Add to roster
|
for child in childs[6:]: # start looping after Add to roster
|
||||||
grandchilds = child.get_children()
|
menu.remove(child)
|
||||||
# check because seperator menuitem doesn't have childs
|
|
||||||
if len(grandchilds):
|
|
||||||
accel_label = grandchilds[0]
|
|
||||||
if accel_label.get_text().startswith(_('Switch to')):
|
|
||||||
menu.remove(child)
|
|
||||||
else: # remove the seperator
|
|
||||||
menu.remove(child)
|
|
||||||
|
|
||||||
return menu
|
return menu
|
||||||
|
|
||||||
|
@ -285,6 +279,7 @@ class Chat:
|
||||||
item.connect('activate', lambda obj, jid:self.set_active_tab(
|
item.connect('activate', lambda obj, jid:self.set_active_tab(
|
||||||
jid), jid)
|
jid), jid)
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
self.how_many_switch_to += 1
|
||||||
|
|
||||||
# show the menu
|
# show the menu
|
||||||
menu.popup(None, None, None, event.button, event.time)
|
menu.popup(None, None, None, event.button, event.time)
|
||||||
|
|
|
@ -202,7 +202,7 @@ class Interface:
|
||||||
def handle_event_http_auth(self, account, data):
|
def handle_event_http_auth(self, account, data):
|
||||||
#('HTTP_AUTH', account, (method, url, iq_obj))
|
#('HTTP_AUTH', account, (method, url, iq_obj))
|
||||||
dialog = dialogs.ConfirmationDialog(_('HTTP (%s) Authorization for %s') \
|
dialog = dialogs.ConfirmationDialog(_('HTTP (%s) Authorization for %s') \
|
||||||
% (array[0], array[1]), _('Do you accept this request?'))
|
% (data[0], data[1]), _('Do you accept this request?'))
|
||||||
if dialog.get_response() == gtk.RESPONSE_OK:
|
if dialog.get_response() == gtk.RESPONSE_OK:
|
||||||
answer = 'yes'
|
answer = 'yes'
|
||||||
else:
|
else:
|
||||||
|
@ -999,6 +999,7 @@ class Interface:
|
||||||
self.handle_event_file_send_error)
|
self.handle_event_file_send_error)
|
||||||
con.register_handler('STANZA_ARRIVED', self.handle_event_stanza_arrived)
|
con.register_handler('STANZA_ARRIVED', self.handle_event_stanza_arrived)
|
||||||
con.register_handler('STANZA_SENT', self.handle_event_stanza_sent)
|
con.register_handler('STANZA_SENT', self.handle_event_stanza_sent)
|
||||||
|
con.register_handler('HTTP_AUTH', self.handle_event_http_auth)
|
||||||
|
|
||||||
def process_connections(self):
|
def process_connections(self):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -389,6 +389,9 @@ class TabbedChatWindow(chat.Chat):
|
||||||
in the last 5 seconds?
|
in the last 5 seconds?
|
||||||
if yes we go active for mouse, composing for kbd
|
if yes we go active for mouse, composing for kbd
|
||||||
if no we go paused if we were previously composing '''
|
if no we go paused if we were previously composing '''
|
||||||
|
if jid not in self.xmls:
|
||||||
|
# the tab with jid is no longer open. stop timer
|
||||||
|
return False # stop looping
|
||||||
current_state = self.chatstates[jid]
|
current_state = self.chatstates[jid]
|
||||||
if current_state is False: # jid doesn't support chatstates
|
if current_state is False: # jid doesn't support chatstates
|
||||||
return False # stop looping
|
return False # stop looping
|
||||||
|
@ -412,6 +415,10 @@ class TabbedChatWindow(chat.Chat):
|
||||||
in the last 30 seconds?
|
in the last 30 seconds?
|
||||||
if yes we go active
|
if yes we go active
|
||||||
if no we go inactive '''
|
if no we go inactive '''
|
||||||
|
if jid not in self.xmls:
|
||||||
|
# the tab with jid is no longer open. stop timer
|
||||||
|
return False # stop looping
|
||||||
|
|
||||||
current_state = self.chatstates[jid]
|
current_state = self.chatstates[jid]
|
||||||
if current_state is False: # jid doesn't support chatstates
|
if current_state is False: # jid doesn't support chatstates
|
||||||
return False # stop looping
|
return False # stop looping
|
||||||
|
|
Loading…
Reference in New Issue