Show realname on JOIN if it is different from nick

master
C. McEnroe 2020-02-09 00:53:55 -05:00
parent e0714a9b7e
commit a212a7ae2c
3 changed files with 19 additions and 3 deletions

View File

@ -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

1
chat.h
View File

@ -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)

View File

@ -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]
);
}