From fd03586f2c38dc8e9f66df81101ab0bbcc2a1ef6 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Fri, 29 Jun 2007 16:25:05 +0000 Subject: [PATCH] use helper function. fixes #3263 --- src/common/contacts.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/common/contacts.py b/src/common/contacts.py index f9fc4d020d..6a5d64477a 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -233,14 +233,11 @@ class Contacts: return contacts_instances return [] - def get_contact_from_full_jid(self, account, jid): + def get_contact_from_full_jid(self, account, fjid): '''we will split the jid into bare jid and resource part, then get proper contact.''' - try: - barejid, resource=jid.split('/',1) - return self.get_contact(account, barejid, resource) - except ValueError: # no resource causes split to fail - return None # how to handle that case? + barejid, resource = common.gajim.get_room_and_nick_from_fjid(fjid) + return self.get_contact(account, barejid, resource) def get_highest_prio_contact_from_contacts(self, contacts): if not contacts: -- GitLab