- bool ValidateParam(User* user, Channel* chan, std::string &word)
- {
- // TODO actually make sure there's a prop for this
- if ((word.length() > 35) || (word.empty()))
+ bool ValidateParam(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE {
+ std::string::size_type p = word.find(':');
+ if (p == std::string::npos)
+ {
+ user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word, "Invalid exemptchanops entry, format is <restriction>:<prefix>"));
+ 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))