summaryrefslogtreecommitdiff
path: root/src/commands/cmd_whowas.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/commands/cmd_whowas.cpp
parent407f8ef1391e5d09e99e0abfc570389decc3ce2d (diff)
Use WriteNumeric() everywhere we send numerics and include the user's nick automatically
Diffstat (limited to 'src/commands/cmd_whowas.cpp')
-rw-r--r--src/commands/cmd_whowas.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/commands/cmd_whowas.cpp b/src/commands/cmd_whowas.cpp
index 175b2bdf3..bdd16b520 100644
--- a/src/commands/cmd_whowas.cpp
+++ b/src/commands/cmd_whowas.cpp
@@ -36,7 +36,7 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use
/* if whowas disabled in config */
if (this->GroupSize == 0 || this->MaxGroups == 0)
{
- user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick.c_str(),name.c_str());
+ user->WriteNumeric(ERR_UNKNOWNCOMMAND, "%s :This command has been disabled.", name.c_str());
return CMD_FAILURE;
}
@@ -44,7 +44,7 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use
if (i == whowas.end())
{
- user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick.c_str(),parameters[0].c_str());
+ user->WriteNumeric(ERR_WASNOSUCHNICK, "%s :There was no such nickname", parameters[0].c_str());
}
else
{
@@ -55,25 +55,25 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use
{
WhoWasGroup* u = *ux;
- user->WriteNumeric(314, "%s %s %s %s * :%s",user->nick.c_str(),parameters[0].c_str(),
+ user->WriteNumeric(RPL_WHOWASUSER, "%s %s %s * :%s", parameters[0].c_str(),
u->ident.c_str(),u->dhost.c_str(),u->gecos.c_str());
if (user->HasPrivPermission("users/auspex"))
- user->WriteNumeric(379, "%s %s :was connecting from *@%s",
- user->nick.c_str(), parameters[0].c_str(), u->host.c_str());
+ user->WriteNumeric(RPL_WHOWASIP, "%s :was connecting from *@%s",
+ parameters[0].c_str(), u->host.c_str());
std::string signon = ServerInstance->TimeString(u->signon);
bool hide_server = (!ServerInstance->Config->HideWhoisServer.empty() && !user->HasPrivPermission("servers/auspex"));
- user->WriteNumeric(312, "%s %s %s :%s",user->nick.c_str(), parameters[0].c_str(), (hide_server ? ServerInstance->Config->HideWhoisServer.c_str() : u->server.c_str()), signon.c_str());
+ user->WriteNumeric(RPL_WHOISSERVER, "%s %s :%s", parameters[0].c_str(), (hide_server ? ServerInstance->Config->HideWhoisServer.c_str() : u->server.c_str()), signon.c_str());
}
}
else
{
- user->WriteNumeric(406, "%s %s :There was no such nickname",user->nick.c_str(),parameters[0].c_str());
+ user->WriteNumeric(ERR_WASNOSUCHNICK, "%s :There was no such nickname", parameters[0].c_str());
}
}
- user->WriteNumeric(369, "%s %s :End of WHOWAS",user->nick.c_str(),parameters[0].c_str());
+ user->WriteNumeric(RPL_ENDOFWHOWAS, "%s :End of WHOWAS", parameters[0].c_str());
return CMD_SUCCESS;
}