diff options
author | Wouter Coekaerts <coekie@irssi.org> | 2006-02-20 11:20:57 +0000 |
---|---|---|
committer | coekie <coekie@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2006-02-20 11:20:57 +0000 |
commit | 461f653d9b34de2d88de7df3547c19dc0954d301 (patch) | |
tree | f4d2719861276ff47e2afc5a83ebfb4169811d12 /src/fe-common | |
parent | 3eedfa4e122044f4e9f5fe4233748c880d281d42 (diff) | |
download | irssi-461f653d9b34de2d88de7df3547c19dc0954d301.zip |
sort nicks with custom prefix by the order defined in isupport in /NAMES
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4247 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/fe-channels.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 5b531c2e..9bc51f37 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -473,12 +473,14 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) NICK_REC *nick; GSList *tmp, *nicklist, *sorted; int nicks, normal, voices, halfops, ops; + const char *nick_flags; nicks = normal = voices = halfops = ops = 0; nicklist = nicklist_getnicks(channel); sorted = NULL; + nick_flags = channel->server->get_nick_flags(channel->server); - /* sort the nicklist */ + /* filter (for flags) and count ops, halfops, voices */ for (tmp = nicklist; tmp != NULL; tmp = tmp->next) { nick = tmp->data; @@ -501,11 +503,13 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) continue; } - sorted = g_slist_insert_sorted(sorted, nick, (GCompareFunc) - nicklist_compare); + sorted = g_slist_prepend(sorted, nick); } g_slist_free(nicklist); + /* sort the nicklist */ + sorted = g_slist_sort_with_data(sorted, (GCompareDataFunc) nicklist_compare, (void *)nick_flags); + /* display the nicks */ if ((flags & CHANNEL_NICKLIST_FLAG_COUNT) == 0) { printformat(channel->server, channel->visible_name, |