summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-06 01:05:09 -0500
committerJune McEnroe <june@causal.agency>2020-02-06 01:05:09 -0500
commit9a585188c546ab65633707c3a3e17dbef1d8e3dc (patch)
treec3e0ad76c7f2a9102bdf7ac7ad9d8d627a8a5996 /command.c
parentSend self.join without colon (diff)
downloadcatgirl-9a585188c546ab65633707c3a3e17dbef1d8e3dc.tar.gz
catgirl-9a585188c546ab65633707c3a3e17dbef1d8e3dc.zip
Add /join command
Diffstat (limited to 'command.c')
-rw-r--r--command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/command.c b/command.c
index e4f035f..3215322 100644
--- a/command.c
+++ b/command.c
@@ -17,6 +17,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "chat.h"
 
@@ -59,6 +60,10 @@ static void commandMe(size_t id, char *params) {
 	commandPrivmsg(id, buf);
 }
 
+static void commandJoin(size_t id, char *params) {
+	ircFormat("JOIN %s\r\n", (params ? params : idNames[id]));
+}
+
 static void commandQuit(size_t id, char *params) {
 	(void)id;
 	set(&self.quit, (params ? params : "Goodbye"));
@@ -78,6 +83,7 @@ static const struct Handler {
 	const char *cmd;
 	Command *fn;
 } Commands[] = {
+	{ "/join", commandJoin },
 	{ "/me", commandMe },
 	{ "/notice", commandNotice },
 	{ "/quit", commandQuit },