Skip to content
Snippets Groups Projects
Commit 73a4bf97 authored by nkour's avatar nkour
Browse files

fix jep0070 accidental reversion

parent 8e7ad660
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ def __init__(self, plugin, account, widget_name):
self.names = {} # what is printed in the tab (eg. user.name)
self.childs = {} # holds the contents for every tab (VBox)
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
self.sent_history = {}
......@@ -233,14 +234,7 @@ def remove_possible_switch_to_menuitems(self, menu):
childs[5].set_no_show_all(True)
for child in childs[6:]: # start looping after Add to roster
grandchilds = child.get_children()
# 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)
menu.remove(child)
return menu
......@@ -285,6 +279,7 @@ def popup_menu(self, event):
item.connect('activate', lambda obj, jid:self.set_active_tab(
jid), jid)
menu.append(item)
self.how_many_switch_to += 1
# show the menu
menu.popup(None, None, None, event.button, event.time)
......
......@@ -202,7 +202,7 @@ def handle_event_information(self, unused, data):
def handle_event_http_auth(self, account, data):
#('HTTP_AUTH', account, (method, url, iq_obj))
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:
answer = 'yes'
else:
......@@ -999,6 +999,7 @@ def register_handlers(self, con):
self.handle_event_file_send_error)
con.register_handler('STANZA_ARRIVED', self.handle_event_stanza_arrived)
con.register_handler('STANZA_SENT', self.handle_event_stanza_sent)
con.register_handler('HTTP_AUTH', self.handle_event_http_auth)
def process_connections(self):
try:
......
......@@ -389,6 +389,9 @@ def check_for_possible_paused_chatstate(self, jid):
in the last 5 seconds?
if yes we go active for mouse, composing for kbd
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]
if current_state is False: # jid doesn't support chatstates
return False # stop looping
......@@ -412,6 +415,10 @@ def check_for_possible_inactive_chatstate(self, jid):
in the last 30 seconds?
if yes we go active
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]
if current_state is False: # jid doesn't support chatstates
return False # stop looping
......
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