summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-11-12 06:51:31 -0500
committerAdam <Adam@anope.org>2013-11-12 06:51:31 -0500
commit6c7a3ceb6c674a9af09da955ee0238e9291cf29a (patch)
treec9fd79d5814685e43f5d9ade75cad5f11da06364 /src/command_parse.cpp
parent407f8ef1391e5d09e99e0abfc570389decc3ce2d (diff)
Use WriteNumeric() everywhere we send numerics and include the user's nick automatically
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index d1ae98729..85365c0c3 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -206,7 +206,7 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
if (!handler)
{
if (user->registered == REG_ALL)
- user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :Unknown command",user->nick.c_str(),command.c_str());
+ user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s :Unknown command",command.c_str());
ServerInstance->stats->statsUnknown++;
return;
}
@@ -256,14 +256,14 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
{
if (!user->IsModeSet(handler->flags_needed))
{
- user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Permission Denied - You do not have the required operator privileges",user->nick.c_str());
+ user->WriteNumeric(ERR_NOPRIVILEGES, ":Permission Denied - You do not have the required operator privileges");
return;
}
if (!user->HasPermission(command))
{
- user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Permission Denied - Oper type %s does not have access to command %s",
- user->nick.c_str(), user->oper->name.c_str(), command.c_str());
+ user->WriteNumeric(ERR_NOPRIVILEGES, ":Permission Denied - Oper type %s does not have access to command %s",
+ user->oper->name.c_str(), command.c_str());
return;
}
}
@@ -273,12 +273,11 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
/* command is disabled! */
if (ServerInstance->Config->DisabledDontExist)
{
- user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :Unknown command",user->nick.c_str(),command.c_str());
+ user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s :Unknown command", command.c_str());
}
else
{
- user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s %s :This command has been disabled.",
- user->nick.c_str(), command.c_str());
+ user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s :This command has been disabled.", command.c_str());
}
ServerInstance->SNO->WriteToSnoMask('t', "%s denied for %s (%s@%s)",
@@ -291,9 +290,9 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
if (command_p.size() < handler->min_params)
{
- user->WriteNumeric(ERR_NEEDMOREPARAMS, "%s %s :Not enough parameters.", user->nick.c_str(), command.c_str());
+ user->WriteNumeric(ERR_NEEDMOREPARAMS, "%s :Not enough parameters.", command.c_str());
if ((ServerInstance->Config->SyntaxHints) && (user->registered == REG_ALL) && (handler->syntax.length()))
- user->WriteNumeric(RPL_SYNTAX, "%s :SYNTAX %s %s", user->nick.c_str(), handler->name.c_str(), handler->syntax.c_str());
+ user->WriteNumeric(RPL_SYNTAX, ":SYNTAX %s %s", handler->name.c_str(), handler->syntax.c_str());
return;
}