chat_control : fix possible var name confusion
roster : Fix resource problem, gajim.contacts.get_contact() can return first contact instead of specified resource. Fixes #3789.
This commit is contained in:
parent
8aa1573e78
commit
a0d8aea90b
|
@ -1217,8 +1217,9 @@ class ChatControl(ChatControlBase):
|
||||||
if acct_info: # We already found a contact with same nick
|
if acct_info: # We already found a contact with same nick
|
||||||
break
|
break
|
||||||
for jid in gajim.contacts.get_jid_list(account):
|
for jid in gajim.contacts.get_jid_list(account):
|
||||||
contact_ = gajim.contacts.get_first_contact_from_jid(account, jid)
|
other_contact_ = \
|
||||||
if contact_.get_shown_name() == self.contact.get_shown_name():
|
gajim.contacts.get_first_contact_from_jid(account, jid)
|
||||||
|
if other_contact_.get_shown_name() == self.contact.get_shown_name():
|
||||||
acct_info = ' (%s)' % \
|
acct_info = ' (%s)' % \
|
||||||
gobject.markup_escape_text(self.account)
|
gobject.markup_escape_text(self.account)
|
||||||
break
|
break
|
||||||
|
|
|
@ -4350,6 +4350,7 @@ class RosterWindow:
|
||||||
type_ = model[path][C_TYPE]
|
type_ = model[path][C_TYPE]
|
||||||
jid = model[path][C_JID].decode('utf-8')
|
jid = model[path][C_JID].decode('utf-8')
|
||||||
resource = None
|
resource = None
|
||||||
|
contact = None
|
||||||
iter = model.get_iter(path)
|
iter = model.get_iter(path)
|
||||||
if type_ in ('group', 'account'):
|
if type_ in ('group', 'account'):
|
||||||
if self.tree.row_expanded(path):
|
if self.tree.row_expanded(path):
|
||||||
|
@ -4386,12 +4387,15 @@ class RosterWindow:
|
||||||
fjid += '/' + resource
|
fjid += '/' + resource
|
||||||
if self.open_event(account, fjid, first_ev):
|
if self.open_event(account, fjid, first_ev):
|
||||||
return
|
return
|
||||||
c = gajim.contacts.get_contact(account, jid, resource)
|
# else
|
||||||
if not c or isinstance(c, list):
|
contact = gajim.contacts.get_contact(account, jid, resource)
|
||||||
c = gajim.contacts.get_contact_with_highest_priority(account, jid)
|
if not contact or isinstance(contact, list):
|
||||||
|
contact = \
|
||||||
|
gajim.contacts.get_contact_with_highest_priority(account, jid)
|
||||||
if jid == gajim.get_jid_from_account(account):
|
if jid == gajim.get_jid_from_account(account):
|
||||||
resource = c.resource
|
resource = contact.resource
|
||||||
self.on_open_chat_window(widget, c, account, resource = resource, session = session)
|
self.on_open_chat_window(widget, contact, account, \
|
||||||
|
resource = resource, session = session)
|
||||||
|
|
||||||
def on_roster_treeview_row_activated(self, widget, path, col = 0):
|
def on_roster_treeview_row_activated(self, widget, path, col = 0):
|
||||||
'''When an iter is double clicked: open the first event window'''
|
'''When an iter is double clicked: open the first event window'''
|
||||||
|
|
Loading…
Reference in New Issue