summaryrefslogtreecommitdiff
path: root/src/roster.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/roster.py')
-rw-r--r--src/roster.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/roster.py b/src/roster.py
index c7717ea8..c5f89218 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -255,11 +255,16 @@ def sort_resource_nb(contact):
def sort_name(contact):
return contact.name.lower() or contact.bare_jid
+def sort_online(contact):
+ result = sort_show(contact)
+ return 0 if result < 5 else 1
+
SORTING_METHODS = {
'jid': sort_jid,
'show': sort_show,
'resource': sort_resource_nb,
'name': sort_name,
+ 'online': sort_online,
}
class RosterGroup(object):