about summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-09 00:53:55 -0500
committerJune McEnroe <june@causal.agency>2020-02-09 00:55:41 -0500
commita212a7ae2c93092068c8a9c483c4575cc65e7491 (patch)
tree95a51bad8681774d8174707532f4763d039f0b12 /handle.c
parentSwitch to "other" window if closing active window (diff)
downloadcatgirl-a212a7ae2c93092068c8a9c483c4575cc65e7491.tar.gz
catgirl-a212a7ae2c93092068c8a9c483c4575cc65e7491.zip
Show realname on JOIN if it is different from nick
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/handle.c b/handle.c
index cf0e853..0297595 100644
--- a/handle.c
+++ b/handle.c
@@ -214,10 +214,17 @@ static void handleJoin(struct Message *msg) {
 		uiShowID(id);
 	}
 	completeTouch(id, msg->nick, hash(msg->user));
+	if (msg->params[2] && !strcasecmp(msg->params[2], msg->nick)) {
+		msg->params[2] = NULL;
+	}
 	uiFormat(
 		id, Cold, tagTime(msg),
-		"\3%02d%s\3\tarrives in \3%02d%s\3",
-		hash(msg->user), msg->nick, hash(msg->params[0]), msg->params[0]
+		"\3%02d%s\3\t%s%s%sarrives in \3%02d%s\3",
+		hash(msg->user), msg->nick,
+		(msg->params[2] ? "(" : ""),
+		(msg->params[2] ? msg->params[2] : ""),
+		(msg->params[2] ? ") " : ""),
+		hash(msg->params[0]), msg->params[0]
 	);
 }