diff options
author | Timo Sirainen <cras@irssi.org> | 2001-07-14 18:19:22 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-07-14 18:19:22 +0000 |
commit | 4425f87f98398605f6998cb1a229e96d813aaed0 (patch) | |
tree | e2605b3ae7c810ab326ec7e900d823507a0ca932 | |
parent | fca13a0fba06fedcc1828ad76f53fa2424e6aec9 (diff) | |
download | irssi-4425f87f98398605f6998cb1a229e96d813aaed0.zip |
/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
-rw-r--r-- | src/fe-common/core/fe-channels.c | 9 | ||||
-rw-r--r-- | 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] [<channels> | **] */ +/* SYNTAX: NAMES [-count | -ops -halfops -voices -normal] [<channels> | **] */ 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); |