Author: jim++ Date: 2008-03-23 18:44:47 +0100 (Sun, 23 Mar 2008) New Revision: 9413
Modified: trunk/src/chat_control.py trunk/src/roster_window.py Log: 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.
Modified: trunk/src/chat_control.py =================================================================== --- trunk/src/chat_control.py 2008-03-23 11:14:50 UTC (rev 9412) +++ trunk/src/chat_control.py 2008-03-23 17:44:47 UTC (rev 9413) @@ -1217,8 +1217,9 @@ if acct_info: # We already found a contact with same nick break for jid in gajim.contacts.get_jid_list(account): - contact_ = gajim.contacts.get_first_contact_from_jid(account, jid) - if contact_.get_shown_name() == self.contact.get_shown_name(): + other_contact_ = \ + gajim.contacts.get_first_contact_from_jid(account, jid) + if other_contact_.get_shown_name() == self.contact.get_shown_name(): acct_info = ' (%s)' % \ gobject.markup_escape_text(self.account) break
Modified: trunk/src/roster_window.py =================================================================== --- trunk/src/roster_window.py 2008-03-23 11:14:50 UTC (rev 9412) +++ trunk/src/roster_window.py 2008-03-23 17:44:47 UTC (rev 9413) @@ -4350,6 +4350,7 @@ type_ = model[path][C_TYPE] jid = model[path][C_JID].decode('utf-8') resource = None + contact = None iter = model.get_iter(path) if type_ in ('group', 'account'): if self.tree.row_expanded(path): @@ -4386,12 +4387,15 @@ fjid += '/' + resource if self.open_event(account, fjid, first_ev): return - c = gajim.contacts.get_contact(account, jid, resource) - if not c or isinstance(c, list): - c = gajim.contacts.get_contact_with_highest_priority(account, jid) + # else + contact = gajim.contacts.get_contact(account, jid, resource) + 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): - resource = c.resource - self.on_open_chat_window(widget, c, account, resource = resource, session = session) + resource = contact.resource + self.on_open_chat_window(widget, contact, account, \ + resource = resource, session = session)
def on_roster_treeview_row_activated(self, widget, path, col = 0): '''When an iter is double clicked: open the first event window'''