aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_remove.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-10-26 23:40:24 +0000
committerGravatar Sadie Powell2020-10-27 00:59:11 +0000
commit7cb27dabe695505d2eb7b942c4fbf518dda8e6b3 (patch)
tree12f7541d3389efa9a084d2a4859d6ce4ede43b03 /src/modules/m_remove.cpp
parentReplace the check for eventfd() with a C++17 header check. (diff)
Convert CmdResult to an 8-bit strongly typed enum.
Diffstat (limited to 'src/modules/m_remove.cpp')
-rw-r--r--src/modules/m_remove.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index 22c2ca48e..b1ce048b6 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -84,24 +84,24 @@ class RemoveBase : public Command
if (!channel)
{
user->WriteNumeric(Numerics::NoSuchChannel(channame));
- return CMD_FAILURE;
+ return CmdResult::FAILURE;
}
if ((!target) || (target->registered != REG_ALL))
{
user->WriteNumeric(Numerics::NoSuchNick(username));
- return CMD_FAILURE;
+ return CmdResult::FAILURE;
}
if (!channel->HasUser(target))
{
user->WriteNotice(InspIRCd::Format("*** User %s is not on channel %s", target->nick.c_str(), channel->name.c_str()));
- return CMD_FAILURE;
+ return CmdResult::FAILURE;
}
if (target->server->IsULine())
{
user->WriteNumeric(ERR_CHANOPRIVSNEEDED, channame, "Only a U-line may remove a U-line from a channel.");
- return CMD_FAILURE;
+ return CmdResult::FAILURE;
}
/* We support the +Q channel mode via. the m_nokicks module, if the module is loaded and the mode is set then disallow the /remove */
@@ -128,7 +128,7 @@ class RemoveBase : public Command
p.push_back(":" + parameters[2]);
ServerInstance->PI->SendEncapsulatedData(target->server->GetName(), "REMOVE", p, user);
- return CMD_SUCCESS;
+ return CmdResult::SUCCESS;
}
std::string reasonparam;
@@ -150,17 +150,17 @@ class RemoveBase : public Command
else
{
user->WriteNotice(InspIRCd::Format("*** You do not have access to /REMOVE %s from %s", target->nick.c_str(), channel->name.c_str()));
- return CMD_FAILURE;
+ return CmdResult::FAILURE;
}
}
else
{
/* m_nokicks.so was loaded and +Q was set, block! */
user->WriteNumeric(ERR_RESTRICTED, channel->name, InspIRCd::Format("Can't remove user %s from channel (+Q is set)", target->nick.c_str()));
- return CMD_FAILURE;
+ return CmdResult::FAILURE;
}
- return CMD_SUCCESS;
+ return CmdResult::SUCCESS;
}
};