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.
master
C. McEnroe 2020-09-18 18:26:13 -04:00
parent 2b8a45779d
commit dce6c11cf6
1 changed files with 6 additions and 2 deletions

View File

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