diff options
| author | 2022-05-10 15:16:21 +0100 | |
|---|---|---|
| committer | 2022-05-12 13:39:24 +0100 | |
| commit | 7922b96408a4908c9ebba363cb9ca63dd195e178 (patch) | |
| tree | 6fa89c444068697987a41272ed3a14fe9f8080a8 /src/modules/m_sapart.cpp | |
| parent | Move 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_sapart.cpp')
| -rw-r--r-- | src/modules/m_sapart.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index d40a58bc6..68399f794 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -28,8 +28,13 @@ class CommandSapart final : public Command { +private: + UserModeReference servprotectmode; + public: - CommandSapart(Module* Creator) : Command(Creator,"SAPART", 2, 3) + CommandSapart(Module* Creator) + : Command(Creator,"SAPART", 2, 3) + , servprotectmode(Creator, "servprotect") { access_needed = CmdAccess::OPERATOR; syntax = { "<nick> <channel>[,<channel>]+ [:<reason>]" }; @@ -50,7 +55,7 @@ public: if (parameters.size() > 2) reason = parameters[2]; - if (dest->server->IsService()) + if (dest->IsModeSet(servprotectmode)) { user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a service"); return CmdResult::FAILURE; |
