diff options
author | C. McEnroe | 2021-04-02 17:03:10 -0400 |
---|---|---|
committer | C. McEnroe | 2021-04-02 17:26:43 -0400 |
commit | df6bc07f44ea3974ba7376d8e3c2b04b0422bf7c (patch) | |
tree | 829dee90325abd56524ceaaa59fd68f053ae6d5c | |
parent | 86a0594cd2a934c1222d45ee69376a8c21426f1c (diff) |
Skip STATUSMSG prefixes
This feature is rarely used, so just skip STATUSMSG prefixes in the target so messages get routed correctly.
-rw-r--r-- | chat.h | 1 | ||||
-rw-r--r-- | handle.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/chat.h b/chat.h index 9f5d454..eb826a8 100644 --- a/chat.h +++ b/chat.h @@ -155,6 +155,7 @@ extern struct Network { uint userLen; uint hostLen; char *chanTypes; + char *statusmsg; char *prefixes; char *prefixModes; char *listModes; diff --git a/handle.c b/handle.c index d889f8e..9f323d1 100644 --- a/handle.c +++ b/handle.c @@ -270,6 +270,9 @@ static void handleReplyISupport(struct Message *msg) { } else if (!strcmp(key, "CHANTYPES")) { if (!msg->params[i]) continue; set(&network.chanTypes, msg->params[i]); + } else if (!strcmp(key, "STATUSMSG")) { + if (!msg->params[i]) continue; + set(&network.statusmsg, msg->params[i]); } else if (!strcmp(key, "PREFIX")) { strsep(&msg->params[i], "("); char *modes = strsep(&msg->params[i], ")"); @@ -1196,6 +1199,9 @@ static void colorMentions(struct Cat *cat, uint id, struct Message *msg) { static void handlePrivmsg(struct Message *msg) { require(msg, true, 2); + if (network.statusmsg) { + msg->params[0] += strspn(msg->params[0], network.statusmsg); + } bool query = !strchr(network.chanTypes, msg->params[0][0]); bool server = strchr(msg->nick, '.'); bool mine = !strcmp(msg->nick, self.nick); |