From b02569e16e4643e65d73c3eb17deb7e3f529fe50 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 2 Apr 2021 17:32:47 -0400 Subject: Skip STATUSMSG prefixes This feature is rarely used, so just skip STATUSMSG prefixes in the target so events use the right context. --- litterbox.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'litterbox.c') diff --git a/litterbox.c b/litterbox.c index c3bc46e..cd7227b 100644 --- a/litterbox.c +++ b/litterbox.c @@ -128,6 +128,7 @@ static int searchLimit = 10; static char *self; static char *network; static char *chanTypes; +static char *statusmsg; static char *prefixes; static char *prefixModes; static char *listModes; @@ -182,6 +183,8 @@ static void handleReplyISupport(struct Message *msg) { set(&network, msg->params[i]); } else if (!strcmp(key, "CHANTYPES")) { set(&chanTypes, msg->params[i]); + } else if (!strcmp(key, "STATUSMSG")) { + set(&statusmsg, msg->params[i]); } else if (!strcmp(key, "PREFIX")) { strsep(&msg->params[i], "("); char *modes = strsep(&msg->params[i], ")"); @@ -429,6 +432,7 @@ static void handlePrivmsg(struct Message *msg) { bool query = true; const char *context = msg->params[0]; + if (statusmsg) context += strspn(context, statusmsg); if (strchr(chanTypes, context[0])) query = false; if (!strcmp(context, self)) context = msg->nick; -- cgit 1.4.1