X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fnumericbuilder.h;h=0d55093ca59c3db15d9f75b787f2872fa7dc918d;hb=35b70631f0532a5828b04a8e0c02092a285f331a;hp=17aa9e0c866bb1ceafe1bae03a30e24fd482157c;hpb=e33e8bcdf8fd3e40eba6a41b43dbc48f973efb11;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/numericbuilder.h b/include/numericbuilder.h index 17aa9e0c8..0d55093ca 100644 --- a/include/numericbuilder.h +++ b/include/numericbuilder.h @@ -196,3 +196,57 @@ class Numeric::ParamBuilder : public GenericParamBuildername); + push(mode->GetModeChar()); + push(parameter); + push(message.empty() ? InspIRCd::Format("Invalid %s mode parameter", mode->name.c_str()) : message); + } + + InvalidModeParameter(User* user, ModeHandler* mode, const std::string& parameter, const std::string& message = "") + : Numeric(ERR_INVALIDMODEPARAM) + { + push(user->registered & REG_NICK ? user->nick : "*"); + push(mode->GetModeChar()); + push(parameter); + push(message.empty() ? InspIRCd::Format("Invalid %s mode parameter", mode->name.c_str()) : message); + } +}; + +/** Builder for the ERR_NOSUCHCHANNEL numeric. */ +class Numerics::NoSuchChannel : public Numeric::Numeric +{ + public: + NoSuchChannel(const std::string& chan) + : Numeric(ERR_NOSUCHCHANNEL) + { + push(chan); + push("No such channel"); + } +}; + +/** Builder for the ERR_NOSUCHNICK numeric. */ +class Numerics::NoSuchNick : public Numeric::Numeric +{ + public: + NoSuchNick(const std::string& nick) + : Numeric(ERR_NOSUCHNICK) + { + push(nick); + push("No such nick"); + } +};