From ba8b8bca3153c4c352c9d95dc06320aa68e89480 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 21 Aug 2007 09:23:34 +0000 Subject: [PATCH] Fix TB when getting score of a not (yet) in the roster contact. fixes #3382 and #3335 --- src/common/contacts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/contacts.py b/src/common/contacts.py index b73ada26f..35308da7f 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -431,9 +431,12 @@ class Contacts: for data_ in family: if data_.has_key('order') and data_['order'] > max_order: max_order = data_['order'] - contact = self.get_contact_with_highest_priority(account, jid) score = (max_order - order)*10000 - + + contact = self.get_contact_with_highest_priority(account, jid) + if not contact: + return score + if common.gajim.get_transport_name_from_jid(jid) is None and \ contact.show not in ('error', 'offline'): score += 10