From 4096e7f42792fbd9290e937f09bd3ec387a3e557 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 31 Jul 2012 21:12:59 +0200 Subject: Also sort the contacts alphabetically Contacts are first sorted alphabetically, and then sorted again depending on their show; since the python sorts are stable, the order will remain and the sub-groups (corresponding to one show type) will be sorted alphabetically too. --- src/roster.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/roster.py b/src/roster.py index 818b3025..56c65d8f 100644 --- a/src/roster.py +++ b/src/roster.py @@ -256,6 +256,7 @@ class RosterGroup(object): return PRESENCE_PRIORITY[show] contact_list = self.contacts if not contact_filter\ else [contact for contact in self.contacts.copy() if contact_filter[0](contact, contact_filter[1])] + contact_list = sorted(contact_list, key=lambda x: x.bare_jid) return sorted(contact_list, key=compare_contact, reverse=True) def toggle_folded(self): -- cgit v1.2.3