diff --git a/src/modules/chanmodes/link.c b/src/modules/chanmodes/link.c index 7b3883df0..c118084a8 100644 --- a/src/modules/chanmodes/link.c +++ b/src/modules/chanmodes/link.c @@ -372,6 +372,10 @@ int link_pre_localjoin_cb(Client *client, Channel *channel, char *parv[]) { strlcpy(bantmp, ban->banstr + 3, sizeof(bantmp)); } else + if (!strncmp(ban->banstr, "~forward:", 9)) + { + strlcpy(bantmp, ban->banstr + 9, sizeof(bantmp)); + } else if (!strncmp(ban->banstr, "~t:", 3)) { /* A timed ban, but is it for us? Need to parse a little: @@ -381,6 +385,28 @@ int link_pre_localjoin_cb(Client *client, Channel *channel, char *parv[]) if (p && !strncmp(p, ":~f:", 4)) { strlcpy(bantmp, p + 4, sizeof(bantmp)); + } else + if (p && !strncmp(p, ":~forward:", 10)) + { + strlcpy(bantmp, p + 10, sizeof(bantmp)); + } else { + /* Not for us - some other ~t ban */ + continue; + } + } else + if (!strncmp(ban->banstr, "~time:", 6)) + { + /* A timed ban, but is it for us? Need to parse a little: + * ~t:dddd:~f:... + */ + char *p = strchr(ban->banstr + 6, ':'); + if (p && !strncmp(p, ":~f:", 4)) + { + strlcpy(bantmp, p + 4, sizeof(bantmp)); + } else + if (p && !strncmp(p, ":~forward:", 10)) + { + strlcpy(bantmp, p + 10, sizeof(bantmp)); } else { /* Not for us - some other ~t ban */ continue; diff --git a/src/modules/extbans/msgbypass.c b/src/modules/extbans/msgbypass.c index 6951edd57..552e1aea0 100644 --- a/src/modules/extbans/msgbypass.c +++ b/src/modules/extbans/msgbypass.c @@ -88,28 +88,32 @@ int msgbypass_can_bypass(Client *client, Channel *channel, BypassChannelMessageR for (ban = channel->exlist; ban; ban=ban->next) { + char *type; + char *matchby; + if (!strncmp(ban->banstr, "~m:", 3)) + type = ban->banstr + 3; + else if (!strncmp(ban->banstr, "~msgbypass:", 11)) + type = ban->banstr + 11; + else + continue; + + if (((bypass_type == BYPASS_CHANMSG_EXTERNAL) && !strncmp(type, "external:", 9)) || + ((bypass_type == BYPASS_CHANMSG_MODERATED) && !strncmp(type, "moderated:", 10)) || + ((bypass_type == BYPASS_CHANMSG_COLOR) && !strncmp(type, "color:", 6)) || + ((bypass_type == BYPASS_CHANMSG_CENSOR) && !strncmp(type, "censor:", 7)) || + ((bypass_type == BYPASS_CHANMSG_NOTICE) && !strncmp(type, "notice:", 7))) { - char *type = ban->banstr + 3; - char *matchby; + matchby = strchr(type, ':'); + if (!matchby) + continue; + matchby++; - if (((bypass_type == BYPASS_CHANMSG_EXTERNAL) && !strncmp(type, "external:", 9)) || - ((bypass_type == BYPASS_CHANMSG_MODERATED) && !strncmp(type, "moderated:", 10)) || - ((bypass_type == BYPASS_CHANMSG_COLOR) && !strncmp(type, "color:", 6)) || - ((bypass_type == BYPASS_CHANMSG_CENSOR) && !strncmp(type, "censor:", 7)) || - ((bypass_type == BYPASS_CHANMSG_NOTICE) && !strncmp(type, "notice:", 7))) + b->banstr = matchby; + if (ban_check_mask(b)) { - matchby = strchr(type, ':'); - if (!matchby) - continue; - matchby++; - - b->banstr = matchby; - if (ban_check_mask(b)) - { - safe_free(b); - return HOOK_ALLOW; /* Yes, user may bypass */ - } + safe_free(b); + return HOOK_ALLOW; /* Yes, user may bypass */ } } }