summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-08 03:19:56 -0500
committerC. McEnroe2020-02-08 03:19:56 -0500
commitff6424a87ce22586c3e2fe1ab57ed3407bef18ca (patch)
tree8a91a82af873a12915a9955e4b0c4470ec31ce96 /command.c
parentb6bf6d62b0bb6d203ce41e4b375c415ca8fde719 (diff)
Add /names
Diffstat (limited to 'command.c')
-rw-r--r--command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/command.c b/command.c
index 9879dbe..a6434bf 100644
--- a/command.c
+++ b/command.c
@@ -101,6 +101,12 @@ static void commandNick(size_t id, char *params) {
 	ircFormat("NICK :%s\r\n", params);
 }
 
+static void commandNames(size_t id, char *params) {
+	(void)params;
+	ircFormat("NAMES :%s\r\n", idNames[id]);
+	replies.names++;
+}
+
 static void commandQuery(size_t id, char *params) {
 	if (!params) return;
 	size_t query = idFor(params);
@@ -137,6 +143,7 @@ static const struct Handler {
 	{ "/debug", commandDebug },
 	{ "/join", commandJoin },
 	{ "/me", commandMe },
+	{ "/names", commandNames },
 	{ "/nick", commandNick },
 	{ "/notice", commandNotice },
 	{ "/part", commandPart },