aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_remove.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_remove.cpp
parentMove unistd out of the global compat header. (diff)
downloadinspircd++-7922b96408a4908c9ebba363cb9ca63dd195e178.tar.gz
inspircd++-7922b96408a4908c9ebba363cb9ca63dd195e178.tar.bz2
inspircd++-7922b96408a4908c9ebba363cb9ca63dd195e178.zip
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_remove.cpp')
-rw-r--r--src/modules/m_remove.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index 74b4c2992..5b41b1ccf 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -36,6 +36,7 @@ class CommandRemove final
{
private:
ChanModeReference nokicksmode;
+ UserModeReference servprotectmode;
public:
unsigned long protectedrank;
@@ -44,6 +45,7 @@ public:
CommandRemove(Module* Creator)
: Command(Creator, "REMOVE", 2, 3)
, nokicksmode(Creator, "nokick")
+ , servprotectmode(Creator, "servprotect")
{
syntax = { "<channel> <nick> [:<reason>]" };
translation = { TR_TEXT, TR_NICK, TR_TEXT };
@@ -84,7 +86,7 @@ public:
return CmdResult::FAILURE;
}
- if (target->server->IsService())
+ if (target->IsModeSet(servprotectmode))
{
user->WriteNumeric(ERR_RESTRICTED, channame, "Only a service may remove a service from a channel.");
return CmdResult::FAILURE;