diff options
author | Peter Powell <petpow@saberuk.com> | 2019-06-12 21:46:07 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-06-12 21:52:58 +0100 |
commit | 9433e34b2133d8f1e77fea15447ba4d0259a5fb0 (patch) | |
tree | 8e6bb357472f2e39c31c82053a1d02d4b1f7460d /src/mode.cpp | |
parent | 938837af9fe92d0fef811db96a5e9d6bf8e3ae11 (diff) |
Show the mode syntax in ERR_INVALIDMODEPARAM.
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index aa4d50b08..159474985 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -89,7 +89,10 @@ void ModeHandler::DisplayEmptyList(User*, Channel*) void ModeHandler::OnParameterMissing(User* user, User* dest, Channel* channel) { - const std::string message = InspIRCd::Format("You must specify a parameter for the %s mode", name.c_str()); + std::string message = InspIRCd::Format("You must specify a parameter for the %s mode.", name.c_str()); + if (!syntax.empty()) + message.append(InspIRCd::Format(" Syntax: %s.", syntax.c_str())); + if (channel) user->WriteNumeric(Numerics::InvalidModeParameter(channel, this, "*", message)); else @@ -171,6 +174,7 @@ PrefixMode::PrefixMode(Module* Creator, const std::string& Name, char ModeLetter , selfremove(true) { list = true; + syntax = "<nick>"; } ModResult PrefixMode::AccessCheck(User* src, Channel*, std::string& value, bool adding) |