From 9b1ab699084190b23953bff7f4ce5410808ab850 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 15 Feb 2020 05:29:54 -0500 Subject: [PATCH] Track PREFIX modes and CHANMODES --- chat.h | 5 +++++ handle.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/chat.h b/chat.h index bb15b3d..ade2ffc 100644 --- a/chat.h +++ b/chat.h @@ -87,6 +87,11 @@ extern struct Network { char *name; char *chanTypes; char *prefixes; + char *prefixModes; + char *listModes; + char *paramModes; + char *setParamModes; + char *channelModes; } network; extern struct Self { diff --git a/handle.c b/handle.c index 6447634..b68ae45 100644 --- a/handle.c +++ b/handle.c @@ -220,9 +220,14 @@ static void handleReplyISupport(struct Message *msg) { } else if (!strcmp(key, "CHANTYPES")) { set(&network.chanTypes, msg->params[i]); } else if (!strcmp(key, "PREFIX")) { - strsep(&msg->params[i], ")"); - if (!msg->params[i]) continue; + strsep(&msg->params[i], "("); + set(&network.prefixModes, strsep(&msg->params[i], ")")); set(&network.prefixes, msg->params[i]); + } else if (!strcmp(key, "CHANMODES")) { + set(&network.listModes, strsep(&msg->params[i], ",")); + set(&network.paramModes, strsep(&msg->params[i], ",")); + set(&network.setParamModes, strsep(&msg->params[i], ",")); + set(&network.channelModes, strsep(&msg->params[i], ",")); } } }