X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_exemptchanops.cpp;h=076445644ba2bfa84644d94eadff7b170a3ea5ed;hb=bdc70892c647f0d7672aba413100730819a4b217;hp=14050430fa3a32df4db026252ed5bcec4f30b382;hpb=5303501b930d3d6c765c24ff69edb722d8a6b5f1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_exemptchanops.cpp b/src/modules/m_exemptchanops.cpp index 14050430f..076445644 100644 --- a/src/modules/m_exemptchanops.cpp +++ b/src/modules/m_exemptchanops.cpp @@ -29,9 +29,23 @@ class ExemptChanOps : public ListModeBase bool ValidateParam(User* user, Channel* chan, std::string &word) { - if (!ServerInstance->Modes->FindMode(word, MODETYPE_CHANNEL)) + std::string::size_type p = word.find(':'); + if (p == std::string::npos) { - user->WriteNumeric(955, "%s %s :Mode doesn't exist", chan->name.c_str(), word.c_str()); + user->WriteNumeric(955, "%s %s :Invalid exemptchanops entry, format is :", chan->name.c_str(), word.c_str()); + return false; + } + + std::string restriction(word, 0, p); + // If there is a '-' in the restriction string ignore it and everything after it + // to support "auditorium-vis" and "auditorium-see" in m_auditorium + p = restriction.find('-'); + if (p != std::string::npos) + restriction.erase(p); + + if (!ServerInstance->Modes->FindMode(restriction, MODETYPE_CHANNEL)) + { + user->WriteNumeric(955, "%s %s :Unknown restriction", chan->name.c_str(), restriction.c_str()); return false; } @@ -83,8 +97,8 @@ class ExemptHandler : public HandlerBase3mask.compare(0, pos, restriction)) + minmode.assign(i->mask, pos + 1, std::string::npos); } }