about summary refs log tree commit diff
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
parentHandle ID overflow (diff)
downloadcatgirl-f5783d15c6a640d553e4e356c4ba10895ad602a3.tar.gz
catgirl-f5783d15c6a640d553e4e356c4ba10895ad602a3.zip
Add /part
-rw-r--r--catgirl.14
-rw-r--r--command.c9
2 files changed, 12 insertions, 1 deletions
diff --git a/catgirl.1 b/catgirl.1
index 5b9b1a5..4dc002e 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -1,4 +1,4 @@
-.Dd February  7, 2020
+.Dd February  8, 2020
 .Dt CATGIRL 1
 .Os
 .
@@ -134,6 +134,8 @@ Send an action message.
 Change nicknames.
 .It Ic /notice Ar message
 Send a notice.
+.It Ic /part Op Ar message
+Leave the channel.
 .It Ic /quit Op Ar message
 Quit IRC.
 .It Ic /quote Ar command
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 },
n title='2021-01-12 21:57:42 -0500'>2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe