about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-12 02:39:23 -0500
committerJune McEnroe <june@causal.agency>2020-02-12 02:39:23 -0500
commit489df70c37d49ab17b396dcffc6776e2ba7829ed (patch)
treed81e0f1379a08da3cc1183b7850c591469068877 /command.c
parentSimplify transpose swap (diff)
downloadcatgirl-489df70c37d49ab17b396dcffc6776e2ba7829ed.tar.gz
catgirl-489df70c37d49ab17b396dcffc6776e2ba7829ed.zip
Add /list
Diffstat (limited to 'command.c')
-rw-r--r--command.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/command.c b/command.c
index 3505a5e..8166e2b 100644
--- a/command.c
+++ b/command.c
@@ -125,6 +125,16 @@ static void commandNames(size_t id, char *params) {
 	replies.names++;
 }
 
+static void commandList(size_t id, char *params) {
+	(void)id;
+	if (params) {
+		ircFormat("LIST :%s\r\n", params);
+	} else {
+		ircFormat("LIST\r\n");
+	}
+	replies.list++;
+}
+
 static void commandWhois(size_t id, char *params) {
 	(void)id;
 	if (!params) return;
@@ -201,6 +211,7 @@ static const struct Handler {
 	{ "/debug", .fn = commandDebug, .restricted = true },
 	{ "/help", .fn = commandHelp },
 	{ "/join", .fn = commandJoin, .restricted = true },
+	{ "/list", .fn = commandList },
 	{ "/me", .fn = commandMe },
 	{ "/msg", .fn = commandMsg, .restricted = true },
 	{ "/names", .fn = commandNames },