aboutsummaryrefslogtreecommitdiffstats
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorGravatar Peter Powell2019-06-12 21:46:07 +0100
committerGravatar Peter Powell2019-06-12 21:52:58 +0100
commit9433e34b2133d8f1e77fea15447ba4d0259a5fb0 (patch)
tree8e6bb357472f2e39c31c82053a1d02d4b1f7460d /src/mode.cpp
parentchanhistory: recreate the mode parameter instead of saving it. (diff)
downloadinspircd++-9433e34b2133d8f1e77fea15447ba4d0259a5fb0.tar.gz
inspircd++-9433e34b2133d8f1e77fea15447ba4d0259a5fb0.tar.bz2
inspircd++-9433e34b2133d8f1e77fea15447ba4d0259a5fb0.zip
Show the mode syntax in ERR_INVALIDMODEPARAM.
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp6
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)