From b917a590dbdf166a84dc35a98fd474eaba3edd0f Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sat, 30 Jul 2022 15:43:11 -0400 Subject: Show STATUSMSG prefix --- handle.c | 11 +++++++++-- 1 file 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]); -- cgit 1.4.1-2-gfad0