diff options
author | C. McEnroe | 2020-09-18 18:26:13 -0400 |
---|---|---|
committer | C. McEnroe | 2020-09-18 18:26:13 -0400 |
commit | dce6c11cf683cad51bc602b682e84c366c60c689 (patch) | |
tree | f84edd55bafcd4791b988fed2ceaf1016b70768e /command.c | |
parent | 2b8a45779dcdb9f94060ddf694e99560ea80dabf (diff) |
Allow 2-param form of /whois, count comma-separated nicks
I do not feel like documenting the 2-param form of /whois because it is weird, but it should work for those who already know about it.
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/command.c b/command.c index 4c51433..0d988cd 100644 --- a/command.c +++ b/command.c @@ -296,8 +296,12 @@ static void commandList(uint id, char *params) { static void commandWhois(uint id, char *params) { (void)id; if (!params) return; - ircFormat("WHOIS :%s\r\n", params); - replies.whois++; + uint count = 1; + for (char *ch = params; *ch; ++ch) { + if (*ch == ',') count++; + } + ircFormat("WHOIS %s\r\n", params); + replies.whois += count; } static void commandNS(uint id, char *params) { |