summaryrefslogtreecommitdiff
path: root/jabber-roster.el
diff options
context:
space:
mode:
authorKirill A. Korinskiy <catap@catap.ru>2009-04-19 19:39:43 +0400
committerKirill A. Korinskiy <catap@catap.ru>2009-04-19 19:39:43 +0400
commit665d11111ae8bd3f19c33c6280a46125c175fd6a (patch)
tree456cd4e5aec61b34487b7838d31040c57416cd14 /jabber-roster.el
parent2f6fdc9e211a577b038d8c799a6de0792f3b2175 (diff)
Rewrite a sorting function
Diffstat (limited to 'jabber-roster.el')
-rw-r--r--jabber-roster.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/jabber-roster.el b/jabber-roster.el
index 5be180e..7855ffe 100644
--- a/jabber-roster.el
+++ b/jabber-roster.el
@@ -754,15 +754,27 @@ three being lists of JID symbols."
hash)
(setq all-groups (append all-groups (list (list group)))))))
+
+ (when jabber-roster-debug
+ (message "remove duplicates from new group"))
(setq all-groups (sort
(remove-duplicates all-groups
- :test 'string=)
- 'string<))
+ :test (lambda (g1 g2)
+ (let ((g1-name (car g1))
+ (g2-name (car g2)))
+ (string= g1-name
+ g2-name))))
+ (lambda (g1 g2)
+ (let ((g1-name (car g1))
+ (g2-name (car g2)))
+ (string< g1-name
+ g2-name)))))
(plist-put (fsm-get-state-data jc) :roster-groups all-groups))
- (message "re display roster")
+ (when jabber-roster-debug
+ (message "re display roster"))
;; recreate roster buffer
(jabber-display-roster)))