summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-05 00:40:24 -0500
committerJune McEnroe <june@causal.agency>2020-02-05 00:40:24 -0500
commit7414a8a11cd8d16fea47e30513b3a5eaeb232ba1 (patch)
treeaaacf18fb8879577480c76693894edf55e7cb0d7 /handle.c
parentAlign MOTD after - (diff)
downloadcatgirl-7414a8a11cd8d16fea47e30513b3a5eaeb232ba1.tar.gz
catgirl-7414a8a11cd8d16fea47e30513b3a5eaeb232ba1.zip
Save own username for message echoing
Diffstat (limited to '')
-rw-r--r--handle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/handle.c b/handle.c
index b5585ba..85783d7 100644
--- a/handle.c
+++ b/handle.c
@@ -187,7 +187,10 @@ static void handleJoin(struct Message *msg) {
 	require(msg, true, 1);
 	size_t id = idFor(msg->params[0]);
 	if (self.nick && !strcmp(msg->nick, self.nick)) {
-		self.color = hash(msg->user);
+		if (!self.user) {
+			set(&self.user, msg->user);
+			self.color = hash(msg->user);
+		}
 		idColors[id] = hash(msg->params[0]);
 		uiShowID(id);
 	}
discriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe