about summary refs log tree commit diff
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
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
-rw-r--r--catgirl.110
-rw-r--r--chat.h1
-rw-r--r--handle.c11
3 files changed, 19 insertions, 3 deletions
diff --git a/catgirl.1 b/catgirl.1
index 4dabb4f..fd00105 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -1,4 +1,4 @@
-.Dd February  8, 2020
+.Dd February  9, 2020
 .Dt CATGIRL 1
 .Os
 .
@@ -287,6 +287,14 @@ join = #ascii.town
 .Bl -item
 .It
 .Rs
+.%A Kiyoshi Aman
+.%T IRCv3.1 extended-join Extension
+.%I IRCv3 Working Group
+.%U https://ircv3.net/specs/extensions/extended-join-3.1
+.Re
+.
+.It
+.Rs
 .%A Waldo Bastian
 .%A Ryan Lortie
 .%A Lennart Poettering
diff --git a/chat.h b/chat.h
index 8bc8e81..896549e 100644
--- a/chat.h
+++ b/chat.h
@@ -59,6 +59,7 @@ static inline size_t idFor(const char *name) {
 }
 
 #define ENUM_CAP \
+	X("extended-join", CapExtendedJoin) \
 	X("sasl", CapSASL) \
 	X("server-time", CapServerTime) \
 	X("userhost-in-names", CapUserhostInNames)
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]
 	);
 }
 
td/> That payload can appear anywhere within an ethernet frame. Wake-on-LAN is funny. 2017-08-04Use $() in install.shJune McEnroe Something gave me the impression that sh did not like this, but it's specified by POSIX. 2017-08-02Create Code Tarmak 3 layoutJune McEnroe 2017-07-31Add tupJune McEnroe 2017-07-31Use designated initializer for hnel tableJune McEnroe I did not know this syntax worked! 2017-07-30Add juneJune McEnroe 2017-07-30Play nethack as ValkyrieJune McEnroe 2017-07-28Add toggle to hnelJune McEnroe 2017-07-28Install slJune McEnroe 2017-07-25Add up, supJune McEnroe 2017-07-24Autopickup ringsJune McEnroe 2017-07-24Name dogJune McEnroe 2017-07-23Add nethackrcJune McEnroe 2017-07-23Remove useless setuid in briJune McEnroe Don't you think it would be better if the setuid bit only gave you permission to do it and didn't do it for you? 2017-07-23Clean up hnel a tiny bitJune McEnroe 2017-07-21Set window size in hnelJune McEnroe 2017-07-21Add hnelJune McEnroe 2017-07-19chmod 600 in dtchJune McEnroe