about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-08 01:25:07 -0500
committerJune McEnroe <june@causal.agency>2020-02-08 01:25:07 -0500
commitf5783d15c6a640d553e4e356c4ba10895ad602a3 (patch)
treeb4e405cc8b58a59edc49b43e5c602339a72326f1 /command.c
parentHandle ID overflow (diff)
downloadcatgirl-f5783d15c6a640d553e4e356c4ba10895ad602a3.tar.gz
catgirl-f5783d15c6a640d553e4e356c4ba10895ad602a3.zip
Add /part
Diffstat (limited to 'command.c')
-rw-r--r--command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/command.c b/command.c
index 7416f81..dfe4850 100644
--- a/command.c
+++ b/command.c
@@ -64,6 +64,14 @@ static void commandJoin(size_t id, char *params) {
 	ircFormat("JOIN %s\r\n", (params ? params : idNames[id]));
 }
 
+static void commandPart(size_t id, char *params) {
+	if (params) {
+		ircFormat("PART %s :%s\r\n", idNames[id], params);
+	} else {
+		ircFormat("PART %s\r\n", idNames[id]);
+	}
+}
+
 static void commandQuit(size_t id, char *params) {
 	(void)id;
 	set(&self.quit, (params ? params : "Goodbye"));
@@ -93,6 +101,7 @@ static const struct Handler {
 	{ "/me", commandMe },
 	{ "/nick", commandNick },
 	{ "/notice", commandNotice },
+	{ "/part", commandPart },
 	{ "/quit", commandQuit },
 	{ "/quote", commandQuote },
 	{ "/window", commandWindow },