diff options
author | Sadie Powell <sadie@witchery.services> | 2020-03-18 10:54:37 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-03-18 11:26:05 +0000 |
commit | 92d83e91038eb54a8200815d5d948c2b61dacce4 (patch) | |
tree | 6816640245f14ba950c0ba8d080f2cf3690d94b6 /src/command_parse.cpp | |
parent | e91a017aca2d314f4d9f4cd20ac17bb6e3b97eb4 (diff) |
Allow commands to override ERR_{NEEDSMOREPARAMS,NOTREGISTERED}.
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index c4e55c3ca..717431087 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -283,9 +283,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman if (command_p.size() < handler->min_params) { user->CommandFloodPenalty += failpenalty; - user->WriteNumeric(ERR_NEEDMOREPARAMS, command, "Not enough parameters."); - if ((ServerInstance->Config->SyntaxHints) && (user->registered == REG_ALL) && (handler->syntax.length())) - user->WriteNumeric(RPL_SYNTAX, handler->name, handler->syntax); + handler->TellNotEnoughParameters(user, command_p); FOREACH_MOD(OnCommandBlocked, (command, command_p, user)); return; } @@ -293,7 +291,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman if ((user->registered != REG_ALL) && (!handler->works_before_reg)) { user->CommandFloodPenalty += failpenalty; - user->WriteNumeric(ERR_NOTREGISTERED, command, "You have not registered"); + handler->TellNotRegistered(user, command_p); FOREACH_MOD(OnCommandBlocked, (command, command_p, user)); } else |