when we compare 2 offline contacts, the one which has a status messages is shown above the one without. fixes #3010

This commit is contained in:
Yann Leboulanger 2007-03-09 19:17:19 +00:00
parent 607f13747e
commit 019f43fa38
2 changed files with 9 additions and 0 deletions

View file

@ -405,6 +405,9 @@ class Contacts:
score += contact.priority * 10
score += ['not in roster', 'error', 'offline', 'invisible', 'dnd', 'xa',
'away', 'chat', 'online', 'requested', 'message'].index(contact.show)
if contact.show == 'offline' and contact.status:
# Offline contacts with a status message have highest score
score += 1
return score
def get_metacontacts_big_brother(self, family):

View file

@ -3956,6 +3956,12 @@ class RosterWindow:
return -1
elif show1 > show2:
return 1
if show1 == 6 and show2 == 6:
# If both are offline, and one has a status message, it is above
if contact1.status and not contact2.status:
return -1
elif contact2.status and not contact1.status:
return 1
# We compare names
if name1.lower() < name2.lower():
return -1