summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-08-01 15:45:10 +0200
committermathieui <mathieui@mathieui.net>2012-08-01 15:45:10 +0200
commitf76e80c5fae108d29ba87a495cd92a1f185c1da2 (patch)
tree85459d871c6a69a3a99a0a6d4f7b29c9dcc190c6
parent9905646184361dba98ad742b39e946bb74580c7a (diff)
downloadpoezio-f76e80c5fae108d29ba87a495cd92a1f185c1da2.tar.gz
poezio-f76e80c5fae108d29ba87a495cd92a1f185c1da2.tar.bz2
poezio-f76e80c5fae108d29ba87a495cd92a1f185c1da2.tar.xz
poezio-f76e80c5fae108d29ba87a495cd92a1f185c1da2.zip
Sort resources from highest priority to lowest
- Previously it was from lowest to highest - Add the “Priority:” info to the “i” key in the roster
-rw-r--r--src/contact.py2
-rw-r--r--src/tabs.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/contact.py b/src/contact.py
index 3de2f496..3a8e38ab 100644
--- a/src/contact.py
+++ b/src/contact.py
@@ -148,7 +148,7 @@ class Contact(object):
def get_resources(self):
"""Return all resources, sorted by priority """
compare_resources = lambda x: x.priority
- return sorted(self.resources, key=compare_resources)
+ return sorted(self.resources, key=compare_resources, reverse=True)
def get_highest_priority_resource(self):
"""Return the resource with the highest priority"""
diff --git a/src/tabs.py b/src/tabs.py
index 4d52a285..7a9affb8 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -2424,10 +2424,11 @@ class RosterInfoTab(Tab):
res.status if res else '',)
elif isinstance(selected_row, Resource):
res = selected_row
- msg = 'Resource: %s (%s)\nCurrent status: %s' % (
+ msg = 'Resource: %s (%s)\nCurrent status: %s\nPriority: %s' % (
res.jid,
res.presence,
- res.status,)
+ res.status,
+ res.priority)
elif isinstance(selected_row, RosterGroup):
rg = selected_row
msg = 'Group: %s [%s/%s] contacts online' % (