about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-26 16:19:30 -0500
committerJune McEnroe <june@causal.agency>2022-02-26 16:19:30 -0500
commit097f17c3e04774f365c7c75f6142ad41b1bc175f (patch)
tree40e782f6cf82d61a1e4d958553cd806642d5bf61
parentRequest twitch.tv/tags capability (diff)
downloadcatgirl-097f17c3e04774f365c7c75f6142ad41b1bc175f.tar.gz
catgirl-097f17c3e04774f365c7c75f6142ad41b1bc175f.zip
Use twitch display-name tag twitch
Not sure if replacing the nick is really the best thing, but since
twitch only lets you change case, it should be safe.
-rw-r--r--chat.h1
-rw-r--r--handle.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/chat.h b/chat.h
index 6c2734f..e5602b5 100644
--- a/chat.h
+++ b/chat.h
@@ -215,6 +215,7 @@ static inline void set(char **field, const char *value) {
 #define ENUM_TAG \
 	X("+draft/reply", TagReply) \
 	X("causal.agency/pos", TagPos) \
+	X("display-name", TagDisplayName) \
 	X("msgid", TagMsgID) \
 	X("time", TagTime)
 
diff --git a/handle.c b/handle.c
index 388a122..e68c4b3 100644
--- a/handle.c
+++ b/handle.c
@@ -80,6 +80,9 @@ static void require(struct Message *msg, bool origin, uint len) {
 		if (!msg->nick) msg->nick = "*.*";
 		if (!msg->user) msg->user = msg->nick;
 		if (!msg->host) msg->host = msg->user;
+		if (msg->tags[TagDisplayName]) {
+			msg->nick = msg->tags[TagDisplayName];
+		}
 	}
 	for (uint i = 0; i < len; ++i) {
 		if (msg->params[i]) continue;
2021-06-18Stop referring to server-time as IRCv3.2June McEnroe 2021-06-17Add mailing list archive to READMEJune McEnroe 2021-06-10Stop accumulating ISUPPORT tokens once MOTD startsJune McEnroe 2021-06-09Use seprintf for snip, removing strlcpynJune McEnroe 2021-06-09Use seprintf for reserializeJune McEnroe 2021-06-09Use seprintf for capListJune McEnroe 2021-06-09Add seprintfJune McEnroe 2021-05-27Add pounce-notify to README 2.4June McEnroe 2021-05-27Fix ENVIRONMENT formatting in pounce-notify(1)June McEnroe 2021-05-27Add note about Libera.Chat SASL-only rangesJune McEnroe 2021-05-25Add QUIRKS fileJune McEnroe 2021-05-19Replace freenode with tilde.chatJune McEnroe 2021-05-04notify: Reword pounce-notify manualJune McEnroe 2021-05-02Clean up Makefiles, configure scriptsJune McEnroe 2021-04-30palaver: Exit on getopt failureJune McEnroe 2021-04-30notify: Implement pounce-notifyJune McEnroe