aboutsummaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-02-28 19:16:40 +0000
committerGravatar Sadie Powell2021-02-28 19:16:40 +0000
commitc22c7e5a99c8f913c12cad13977d7c56fa7ee8e4 (patch)
treeb044fa7ab25ac5cf769e5eb6dfa4dda85030794d /src/mode.cpp
parentMerge branch 'insp3' into master. (diff)
parentFix running configure on systems with old versions of Perl. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 64f844e28..ddcddda6a 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -96,6 +96,14 @@ void ModeHandler::OnParameterMissing(User* user, User* dest, Channel* channel)
user->WriteNumeric(Numerics::InvalidModeParameter(dest, this, "*", message));
}
+void ModeHandler::OnParameterInvalid(User* user, Channel* targetchannel, User* targetuser, const std::string& parameter)
+{
+ if (targetchannel)
+ user->WriteNumeric(Numerics::InvalidModeParameter(targetchannel, this, "*"));
+ else
+ user->WriteNumeric(Numerics::InvalidModeParameter(targetuser, this, "*"));
+}
+
bool ModeHandler::ResolveModeConflict(std::string& theirs, const std::string& ours, Channel*)
{
return (theirs < ours);
@@ -390,7 +398,10 @@ static bool IsModeParamValid(User* user, Channel* targetchannel, User* targetuse
// The parameter cannot begin with a ':' character or contain a space
if ((item.param[0] == ':') || (item.param.find(' ') != std::string::npos))
+ {
+ item.mh->OnParameterInvalid(user, targetchannel, targetuser, item.param);
return false;
+ }
return true;
}