diff options
author | mathieui <mathieui@mathieui.net> | 2012-07-31 21:12:59 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-07-31 21:12:59 +0200 |
commit | 4096e7f42792fbd9290e937f09bd3ec387a3e557 (patch) | |
tree | 63ff0f74eb8dfd0304e340838be1f33f6260f7ce /src | |
parent | 4a7f6c5eaf2d4fa721e3ce80860d65f48d38b375 (diff) | |
download | poezio-4096e7f42792fbd9290e937f09bd3ec387a3e557.tar.gz poezio-4096e7f42792fbd9290e937f09bd3ec387a3e557.tar.bz2 poezio-4096e7f42792fbd9290e937f09bd3ec387a3e557.tar.xz poezio-4096e7f42792fbd9290e937f09bd3ec387a3e557.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/roster.py | 1 |
1 files changed, 1 insertions, 0 deletions
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): |