From e4eb97e5126d5f100ac29a34e43afa6fb9f663e2 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 29 Nov 2018 05:37:10 -0500 Subject: Add /whois --- input.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'input.c') 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", ¶ms, "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]); -- cgit 1.4.1-2-gfad0