hirc

IRC client
Log | Files | Refs

commit a8fa163c879db68f261d3ff072e74cecc5a0e304
parent 2b57c19675f64501490af1d83965cc73996d9dbe
Author: hhvn <dev@hhvn.uk>
Date:   Fri,  4 Mar 2022 17:06:55 +0000

/who

Diffstat:
Msrc/commands.c | 12++++++++++++
Msrc/config.c | 4++--
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/commands.c b/src/commands.c @@ -49,6 +49,7 @@ COMMAND(command_mode); COMMAND(command_nick); COMMAND(command_list); COMMAND(command_whois); +COMMAND(command_who); COMMAND(command_whowas); COMMAND(command_ping); COMMAND(command_quote); @@ -128,6 +129,9 @@ struct Command commands[] = { {"whois", command_whois, 1, { "usage: /whois [server] [nick]", "Request information on a nick or oneself", NULL}}, + {"who", command_who, 1, { + "usage: /whois [mask [options]]", + "Request short information on nicks", NULL}}, {"whowas", command_whowas, 1, { "usage: /whowas [nick [count [server]]]", "Request information on old nicks", @@ -562,6 +566,14 @@ command_whois) { } COMMAND( +command_who) { + if (!str) + str = "*"; /* wildcard */ + + ircprintf(server, "WHO %s\r\n", str); +} + +COMMAND( command_whowas) { char *nick, *count, *tserver; diff --git a/src/config.c b/src/config.c @@ -730,7 +730,7 @@ struct Config config[] = { .description = { "Format of RPL_WHOWASUSER (314) numeric", NULL}}, {"format.rpl.endofwho", 1, Val_string, - .str = "${2-}", + .str = "End of WHO results for ${2}", .strhandle = config_redraws, .description = { "Format of RPL_ENDOFWHO (315) numeric", NULL}}, @@ -795,7 +795,7 @@ struct Config config[] = { .description = { "Format of RPL_VERSION (351) numeric", NULL}}, {"format.rpl.whoreply", 1, Val_string, - .str = "${2-}", + .str = "%{b}${6}!${3}@${4}%{b} (%{split:2, ,${8}}): ${7} %{split:1, ,${8}}", .strhandle = config_redraws, .description = { "Format of RPL_WHOREPLY (352) numeric", NULL}},