about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-09-18 18:26:13 -0400
committerJune McEnroe <june@causal.agency>2020-09-18 18:26:13 -0400
commitdce6c11cf683cad51bc602b682e84c366c60c689 (patch)
treef84edd55bafcd4791b988fed2ceaf1016b70768e
parentSwitch back to checking for server by nick with '.' (diff)
downloadcatgirl-dce6c11cf683cad51bc602b682e84c366c60c689.tar.gz
catgirl-dce6c11cf683cad51bc602b682e84c366c60c689.zip
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.
-rw-r--r--command.c8
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) {
;id=36bdb2171f7154fcdf1a24d38c8ce3bd7e448cb1&follow=1'>Replace most uses of strncmp() with prefixcmp()Lukas Fleischer 2014-01-09README: Fix dependenciesLukas Fleischer 2014-01-08README: Spelling and formatting fixesLukas Fleischer 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch 2014-01-08Add a suggestion to the manpagePřemysl Janouch 2014-01-08Fix the example configurationPřemysl Janouch 2014-01-08Fix about-formatting.shPřemysl Janouch 2014-01-08Fix some spelling errorsPřemysl Janouch 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts