aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_sakick.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-05-10 15:16:21 +0100
committerGravatar Sadie Powell2022-05-12 13:39:24 +0100
commit7922b96408a4908c9ebba363cb9ca63dd195e178 (patch)
tree6fa89c444068697987a41272ed3a14fe9f8080a8 /src/modules/m_sakick.cpp
parentMove unistd out of the global compat header. (diff)
Use the servprotect mode to protect services.
Anope and Atheme already set this on their clients so no downstream changes are needed. Closes #781.
Diffstat (limited to 'src/modules/m_sakick.cpp')
-rw-r--r--src/modules/m_sakick.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp
index 5ba5710d9..7175d5ae2 100644
--- a/src/modules/m_sakick.cpp
+++ b/src/modules/m_sakick.cpp
@@ -27,8 +27,13 @@
class CommandSakick final
: public Command
{
+private:
+ UserModeReference servprotectmode;
+
public:
- CommandSakick(Module* Creator) : Command(Creator,"SAKICK", 2, 3)
+ CommandSakick(Module* Creator)
+ : Command(Creator,"SAKICK", 2, 3)
+ , servprotectmode(Creator, "servprotect")
{
access_needed = CmdAccess::OPERATOR;
syntax = { "<channel> <nick> [:<reason>]" };
@@ -44,7 +49,7 @@ public:
{
const std::string& reason = (parameters.size() > 2) ? parameters[2] : dest->nick;
- if (dest->server->IsService())
+ if (dest->IsModeSet(servprotectmode))
{
user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a service");
return CmdResult::FAILURE;