summary refs log tree commit diff
path: root/input.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-29 05:37:10 -0500
committerJune McEnroe <june@causal.agency>2018-11-29 05:40:26 -0500
commite4eb97e5126d5f100ac29a34e43afa6fb9f663e2 (patch)
treea335c82a326bad9aa33a6425c96cdd50539b7c5f /input.c
parentSet LIBRESSL_PREFIX in Darwin.mk (diff)
downloadcatgirl-e4eb97e5126d5f100ac29a34e43afa6fb9f663e2.tar.gz
catgirl-e4eb97e5126d5f100ac29a34e43afa6fb9f663e2.zip
Add /whois
Diffstat (limited to 'input.c')
-rw-r--r--input.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/input.c b/input.c
index 3a3d499..85c240f 100644
--- a/input.c
+++ b/input.c
@@ -87,6 +87,13 @@ static void inputWho(struct Tag tag, char *params) {
 	ircFmt("WHO %s\r\n", tag.name);
 }
 
+static void inputWhois(struct Tag tag, char *params) {
+	(void)tag;
+	char *nick = param("/whois", &params, "nick");
+	if (!nick) return;
+	ircFmt("WHOIS %s\r\n", nick);
+}
+
 static void inputTopic(struct Tag tag, char *params) {
 	if (params) {
 		ircFmt("TOPIC %s :%s\r\n", tag.name, params);
@@ -104,7 +111,7 @@ static void inputQuit(struct Tag tag, char *params) {
 	}
 }
 
-static void inputUrl(struct Tag tag, char *params) {
+static void inputURL(struct Tag tag, char *params) {
 	(void)params;
 	urlList(tag);
 }
@@ -163,9 +170,10 @@ static const struct {
 	{ "/query", inputQuery },
 	{ "/quit", inputQuit },
 	{ "/topic", inputTopic },
-	{ "/url", inputUrl },
+	{ "/url", inputURL },
 	{ "/view", inputView },
 	{ "/who", inputWho },
+	{ "/whois", inputWhois },
 };
 static const size_t CommandsLen = sizeof(Commands) / sizeof(Commands[0]);