summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-07-30 15:43:11 -0400
committerJune McEnroe <june@causal.agency>2022-07-30 15:43:11 -0400
commitb917a590dbdf166a84dc35a98fd474eaba3edd0f (patch)
tree42df5205bdb96c832307a0e3ea1ceba21f593f66
parentRefactor colorMentions to be seprintf-like (diff)
downloadcatgirl-b917a590dbdf166a84dc35a98fd474eaba3edd0f.tar.gz
catgirl-b917a590dbdf166a84dc35a98fd474eaba3edd0f.zip
Show STATUSMSG prefix
Diffstat (limited to '')
-rw-r--r--handle.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/handle.c b/handle.c
index 21d3c39..d98a72c 100644
--- a/handle.c
+++ b/handle.c
@@ -1290,8 +1290,10 @@ rest:
 
 static void handlePrivmsg(struct Message *msg) {
 	require(msg, true, 2);
-	if (network.statusmsg) {
-		msg->params[0] += strspn(msg->params[0], network.statusmsg);
+	char statusmsg = '\0';
+	if (network.statusmsg && strchr(network.statusmsg, msg->params[0][0])) {
+		statusmsg = msg->params[0][0];
+		msg->params[0]++;
 	}
 	bool query = !strchr(network.chanTypes, msg->params[0][0]);
 	bool server = strchr(msg->nick, '.');
@@ -1319,6 +1321,11 @@ static void handlePrivmsg(struct Message *msg) {
 
 	char buf[1024];
 	char *ptr = buf, *end = &buf[sizeof(buf)];
+	if (statusmsg) {
+		ptr = seprintf(
+			ptr, end, "\3%d[%c]\3 ", hash(msg->params[0]), statusmsg
+		);
+	}
 	if (notice) {
 		if (id != Network) {
 			logFormat(id, tagTime(msg), "-%s- %s", msg->nick, msg->params[1]);
gure?h=2.5&id=eea88e1ccb303f6677165314c1dc0bf8fdd57d6b&follow=1'>Fix LDADD.crypt on DarwinJune McEnroe 2021-06-18Add -m mode option to set user modesJune McEnroe 2021-06-18Document channel keys in join optionJune McEnroe 2021-06-18Use | to separate flags from config optionsJune McEnroe 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