+ std::string restriction;
+ std::string prefix;
+ if (!ParseEntry(word, restriction, prefix))
+ {
+ user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word));
+ return false;
+ }
+
+ // If there is a '-' in the restriction string ignore it and everything after it
+ // to support "auditorium-vis" and "auditorium-see" in m_auditorium
+ std::string::size_type dash = restriction.find('-');
+ if (dash != std::string::npos)
+ restriction.erase(dash);
+
+ if (!ServerInstance->Modes->FindMode(restriction, MODETYPE_CHANNEL))
+ {
+ user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word, "Unknown restriction."));
+ return false;
+ }
+
+ if (prefix != "*" && !FindMode(prefix))
+ {
+ user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word, "Unknown prefix mode."));
+ return false;
+ }
+
+ return true;