From d8c9eccd70d709a2089097ff0da0ebd2df60b999 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Jan 2006 19:56:35 +0000 Subject: [PATCH] use new contacts functions in common/gajim.py --- src/common/gajim.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/gajim.py b/src/common/gajim.py index 9c81956f0..2ae16817f 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -148,18 +148,19 @@ def get_real_jid_from_fjid(account, fjid): gcs = interface.instances[account]['gc'] if gcs.has_key(room_jid): # It's a pm, so if we have real jid it's in contact.jid - if not gc_contacts[account][room_jid].has_key(nick): + gc_contact = contacts.get_gc_contact(account, room_jid, nick) + if not gc_contact: return - contact = gc_contacts[account][room_jid][nick] - # contact.jid is None when it's not a real jid (we don't know real jid) - real_jid = contact.jid + # gc_contact.jid is None when it's not a real jid (we don't know real jid) + real_jid = gc_contact.jid return real_jid def get_room_from_fjid(jid): return get_room_and_nick_from_fjid(jid)[0] def get_contact_name_from_jid(account, jid): - return contacts[account][jid][0].name + c = contacts.get_first_contact_from_jid(account, jid) + return c.name def get_jid_without_resource(jid): return jid.split('/')[0]