1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

/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
This commit is contained in:
Timo Sirainen 2001-07-14 18:19:22 +00:00 committed by cras
parent fca13a0fba
commit 4425f87f98
2 changed files with 7 additions and 3 deletions

View File

@ -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");
}

View File

@ -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);