summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--handle.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/handle.c b/handle.c
index a111b16..8a68c95 100644
--- a/handle.c
+++ b/handle.c
@@ -201,6 +201,18 @@ static void handleJoin(struct Message *msg) {
 	);
 }
 
+static void handlePart(struct Message *msg) {
+	require(msg, true, 1);
+	size_t id = idFor(msg->params[0]);
+	uiFormat(
+		id, Cold, tagTime(msg),
+		"\3%02d%s\3\tleaves \3%02d%s\3%s%s",
+		hash(msg->user), msg->nick, idColors[id], idNames[id],
+		(msg->params[1] ? ": " : ""),
+		(msg->params[1] ? msg->params[1] : "")
+	);
+}
+
 static bool isAction(struct Message *msg) {
 	if (strncmp(msg->params[1], "\1ACTION ", 8)) return false;
 	msg->params[1] += 8;
@@ -256,6 +268,7 @@ static const struct Handler {
 	{ "ERROR", handleError },
 	{ "JOIN", handleJoin },
 	{ "NOTICE", handlePrivmsg },
+	{ "PART", handlePart },
 	{ "PING", handlePing },
 	{ "PRIVMSG", handlePrivmsg },
 };
r versions of libedit have sane tab-complete now without FreeBSD's hacks, and in fact the hack is gone in FreeBSD-CURRENT. I'm still a little confused why binding this weird function is necessary at all, but at least it exists everywhere, I guess. 2020-06-08Prefix mandoc with exec in about-filterJune McEnroe 2020-06-07Remove mktemp options from mkbuiltins, mktokensJune McEnroe Why even? 2020-06-07Cast z_stream fields to size_tJune McEnroe In the version of zlib in OpenBSD, these fields are of type off_t, which is signed (why?), rather than uLong. 2020-06-07Call static_assert by _Static_assertJune McEnroe OpenBSD doesn't #define static_assert in assert.h and _Static_assert is its real name I guess so why not? 2020-06-07Add OpenBSD to install.shJune McEnroe Straightforward. 2020-06-03Add The Song of AchillesJune McEnroe 2020-06-01Allow redirecting input in everJune McEnroe 2020-05-31Add %c conversion to c scriptJune McEnroe 2020-05-31Add c script to READMEJune McEnroe 2020-05-31Add c scriptJune McEnroe 2020-05-31Update mdoc source URLsJune McEnroe 2020-05-26Remove unfinished PSF fontsJune McEnroe