Comment and clarify roster_window.on_message()
This commit is contained in:
parent
6953685979
commit
aec02d72db
|
@ -2127,14 +2127,15 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
if resource:
|
if resource:
|
||||||
fjid = jid + '/' + resource
|
fjid = jid + '/' + resource
|
||||||
contact = gajim.contacts.get_contact(account, jid, resource)
|
contact = gajim.contacts.get_contact(account, jid, resource)
|
||||||
# Default to highest prio
|
|
||||||
highest_contact = gajim.contacts.get_contact_with_highest_priority(
|
|
||||||
account, jid)
|
|
||||||
if not contact:
|
if not contact:
|
||||||
|
# Default to highest prio
|
||||||
|
highest_contact = gajim.contacts.get_contact_with_highest_priority(
|
||||||
|
account, jid)
|
||||||
fjid = jid
|
fjid = jid
|
||||||
resource_for_chat = None
|
resource_for_chat = None
|
||||||
contact = highest_contact
|
contact = highest_contact
|
||||||
if not contact:
|
if not contact:
|
||||||
|
# contact is not in roster
|
||||||
keyID = ''
|
keyID = ''
|
||||||
attached_keys = gajim.config.get_per('accounts', account,
|
attached_keys = gajim.config.get_per('accounts', account,
|
||||||
'attached_gpg_keys').split()
|
'attached_gpg_keys').split()
|
||||||
|
@ -2152,8 +2153,6 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
path = self.tree.get_model().get_path(iters[0])
|
path = self.tree.get_model().get_path(iters[0])
|
||||||
else:
|
else:
|
||||||
path = None
|
path = None
|
||||||
autopopup = gajim.config.get('autopopup')
|
|
||||||
autopopupaway = gajim.config.get('autopopupaway')
|
|
||||||
|
|
||||||
# Look for a chat control that has the given resource
|
# Look for a chat control that has the given resource
|
||||||
ctrl = gajim.interface.msg_win_mgr.get_control(fjid, account)
|
ctrl = gajim.interface.msg_win_mgr.get_control(fjid, account)
|
||||||
|
@ -2170,10 +2169,8 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
no_queue = True
|
no_queue = True
|
||||||
if qs.has_key(fjid):
|
if qs.has_key(fjid):
|
||||||
no_queue = False
|
no_queue = False
|
||||||
popup = False
|
|
||||||
if autopopup and (autopopupaway or gajim.connections[account].connected \
|
popup = helpers.allow_popup_window(account)
|
||||||
in (1, 2)):
|
|
||||||
popup = True
|
|
||||||
|
|
||||||
if msg_type == 'normal' and popup: # it's single message to be autopopuped
|
if msg_type == 'normal' and popup: # it's single message to be autopopuped
|
||||||
dialogs.SingleMessageWindow(account, contact.jid,
|
dialogs.SingleMessageWindow(account, contact.jid,
|
||||||
|
@ -2205,6 +2202,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
if not ctrl:
|
if not ctrl:
|
||||||
self.new_chat(contact, account, resource = resource_for_chat)
|
self.new_chat(contact, account, resource = resource_for_chat)
|
||||||
if path:
|
if path:
|
||||||
|
# we curently see contact in our roster OR he
|
||||||
|
# is not in the roster at all.
|
||||||
|
# show and select his line in roster
|
||||||
self.tree.expand_row(path[0:1], False)
|
self.tree.expand_row(path[0:1], False)
|
||||||
self.tree.expand_row(path[0:2], False)
|
self.tree.expand_row(path[0:2], False)
|
||||||
self.tree.scroll_to_cell(path)
|
self.tree.scroll_to_cell(path)
|
||||||
|
@ -2216,9 +2216,13 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
self.draw_parent_contact(jid, account)
|
self.draw_parent_contact(jid, account)
|
||||||
self.show_title() # we show the * or [n]
|
self.show_title() # we show the * or [n]
|
||||||
if not path:
|
if not path:
|
||||||
|
# contact is in roster but we curently don't see him online
|
||||||
|
# show him
|
||||||
self.add_contact_to_roster(jid, account)
|
self.add_contact_to_roster(jid, account)
|
||||||
iters = self.get_contact_iter(jid, account)
|
iters = self.get_contact_iter(jid, account)
|
||||||
path = self.tree.get_model().get_path(iters[0])
|
path = self.tree.get_model().get_path(iters[0])
|
||||||
|
# popup == False so we show awaiting event in roster
|
||||||
|
# show and select contact line in roster (even if he is not in roster)
|
||||||
self.tree.expand_row(path[0:1], False)
|
self.tree.expand_row(path[0:1], False)
|
||||||
self.tree.expand_row(path[0:2], False)
|
self.tree.expand_row(path[0:2], False)
|
||||||
self.tree.scroll_to_cell(path)
|
self.tree.scroll_to_cell(path)
|
||||||
|
|
Loading…
Reference in New Issue