From 4425f87f98398605f6998cb1a229e96d813aaed0 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 14 Jul 2001 18:19:22 +0000 Subject: [PATCH] /NAMES -count: print only the Total xxx nicks line git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1615 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-channels.c | 9 ++++++--- src/fe-common/core/fe-channels.h | 1 + 2 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 67557b91..a2c86e33 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -465,7 +465,8 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) /* display the nicks */ printformat(channel->server, channel->name, MSGLEVEL_CRAP, TXT_NAMES, channel->name, ""); - display_sorted_nicks(channel, sorted); + if ((flags & CHANNEL_NICKLIST_FLAG_COUNT) == 0) + display_sorted_nicks(channel, sorted); g_slist_free(sorted); printformat(channel->server, channel->name, @@ -473,7 +474,7 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) channel->name, nicks, ops, voices, normal); } -/* SYNTAX: NAMES [-ops -halfops -voices -normal] [ | **] */ +/* SYNTAX: NAMES [-count | -ops -halfops -voices -normal] [ | **] */ static void cmd_names(const char *data, SERVER_REC *server, WI_ITEM_REC *item) { CHANNEL_REC *chanrec; @@ -507,6 +508,8 @@ static void cmd_names(const char *data, SERVER_REC *server, WI_ITEM_REC *item) flags |= CHANNEL_NICKLIST_FLAG_VOICES; if (g_hash_table_lookup(optlist, "normal") != NULL) flags |= CHANNEL_NICKLIST_FLAG_NORMAL; + if (g_hash_table_lookup(optlist, "count") != NULL) + flags |= CHANNEL_NICKLIST_FLAG_COUNT; if (flags == 0) flags = CHANNEL_NICKLIST_FLAG_ALL; @@ -587,7 +590,7 @@ void fe_channels_init(void) command_bind("cycle", NULL, (SIGNAL_FUNC) cmd_cycle); command_set_options("channel add", "auto noauto -bots -botcmd"); - command_set_options("names", "ops halfops voices normal"); + command_set_options("names", "count ops halfops voices normal"); command_set_options("join", "window"); } diff --git a/src/fe-common/core/fe-channels.h b/src/fe-common/core/fe-channels.h index a8aa697e..e9a03a12 100644 --- a/src/fe-common/core/fe-channels.h +++ b/src/fe-common/core/fe-channels.h @@ -6,6 +6,7 @@ #define CHANNEL_NICKLIST_FLAG_VOICES 0x04 #define CHANNEL_NICKLIST_FLAG_NORMAL 0x08 #define CHANNEL_NICKLIST_FLAG_ALL 0x0f +#define CHANNEL_NICKLIST_FLAG_COUNT 0x10 void fe_channels_nicklist(CHANNEL_REC *channel, int flags);