summaryrefslogtreecommitdiff
path: root/src/roster.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-07-31 20:51:18 +0200
committermathieui <mathieui@mathieui.net>2012-07-31 20:51:18 +0200
commit4a7f6c5eaf2d4fa721e3ce80860d65f48d38b375 (patch)
tree56f23efcc83f9129c5169a110a4864eec58723c9 /src/roster.py
parentee97ba6b6cf96d2f6f0dd67928da4f370bab9f12 (diff)
downloadpoezio-4a7f6c5eaf2d4fa721e3ce80860d65f48d38b375.tar.gz
poezio-4a7f6c5eaf2d4fa721e3ce80860d65f48d38b375.tar.bz2
poezio-4a7f6c5eaf2d4fa721e3ce80860d65f48d38b375.tar.xz
poezio-4a7f6c5eaf2d4fa721e3ce80860d65f48d38b375.zip
Sort the contacts in the roster groups by show (xa/away/…)
Diffstat (limited to 'src/roster.py')
-rw-r--r--src/roster.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/roster.py b/src/roster.py
index c86b33ac..818b3025 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -247,9 +247,10 @@ class RosterGroup(object):
def get_contacts(self, contact_filter):
"""Return the group contacts, filtered and sorted"""
def compare_contact(a):
- if not a.get_highest_priority_resource():
+ res = a.get_highest_priority_resource()
+ if not res:
return 0
- show = a.get_highest_priority_resource()
+ show = res.presence
if show not in PRESENCE_PRIORITY:
return 5
return PRESENCE_PRIORITY[show]