Author: liori Date: 2007-06-28 01:26:07 +0200 (Thu, 28 Jun 2007) New Revision: 8334
Modified: trunk/src/common/contacts.py Log: contacts.py: get_contact_from_full_jid not to raise exceptions on bare jids
Modified: trunk/src/common/contacts.py =================================================================== --- trunk/src/common/contacts.py 2007-06-27 22:57:01 UTC (rev 8333) +++ trunk/src/common/contacts.py 2007-06-27 23:26:07 UTC (rev 8334) @@ -236,8 +236,12 @@ def get_contact_from_full_jid(self, account, jid): '''we will split the jid into bare jid and resource part, then get proper contact.''' - barejid, resource=jid.split('/',1) - return self.get_contact(account, barejid, resource) + 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? + def get_highest_prio_contact_from_contacts(self, contacts): if not contacts: return None