summaryrefslogtreecommitdiff
path: root/src/commands/cmd_topic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/cmd_topic.cpp')
-rw-r--r--src/commands/cmd_topic.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/commands/cmd_topic.cpp b/src/commands/cmd_topic.cpp
index 8f5979865..38982a7a2 100644
--- a/src/commands/cmd_topic.cpp
+++ b/src/commands/cmd_topic.cpp
@@ -58,7 +58,7 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters,
Channel* c = ServerInstance->FindChan(parameters[0]);
if (!c)
{
- user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[0].c_str());
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str());
return CMD_FAILURE;
}
@@ -68,18 +68,18 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters,
{
if ((c->IsModeSet(secretmode)) && (!c->HasUser(user)))
{
- user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), c->name.c_str());
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", c->name.c_str());
return CMD_FAILURE;
}
if (c->topic.length())
{
- user->WriteNumeric(332, "%s %s :%s", user->nick.c_str(), c->name.c_str(), c->topic.c_str());
- user->WriteNumeric(333, "%s %s %s %lu", user->nick.c_str(), c->name.c_str(), c->setby.c_str(), (unsigned long)c->topicset);
+ user->WriteNumeric(RPL_TOPIC, "%s :%s", c->name.c_str(), c->topic.c_str());
+ user->WriteNumeric(RPL_TOPICTIME, "%s %s %lu", c->name.c_str(), c->setby.c_str(), (unsigned long)c->topicset);
}
else
{
- user->WriteNumeric(RPL_NOTOPICSET, "%s %s :No topic is set.", user->nick.c_str(), c->name.c_str());
+ user->WriteNumeric(RPL_NOTOPICSET, "%s :No topic is set.", c->name.c_str());
}
}
return CMD_SUCCESS;
@@ -95,12 +95,12 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters,
{
if (!c->HasUser(user))
{
- user->WriteNumeric(442, "%s %s :You're not on that channel!", user->nick.c_str(), c->name.c_str());
+ user->WriteNumeric(ERR_NOTONCHANNEL, "%s :You're not on that channel!", c->name.c_str());
return CMD_FAILURE;
}
if (c->IsModeSet(topiclockmode) && !ServerInstance->OnCheckExemption(user, c, "topiclock").check(c->GetPrefixValue(user) >= HALFOP_VALUE))
{
- user->WriteNumeric(482, "%s %s :You do not have access to change the topic on this channel", user->nick.c_str(), c->name.c_str());
+ user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s :You do not have access to change the topic on this channel", c->name.c_str());
return CMD_FAILURE;
}
}