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_saquit.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_saquit.cpp')
| -rw-r--r-- | src/modules/m_saquit.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 6f1a6d687..1b00e5dce 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -30,8 +30,13 @@ class CommandSaquit final : public Command { +private: + UserModeReference servprotectmode; + public: - CommandSaquit(Module* Creator) : Command(Creator, "SAQUIT", 2, 2) + CommandSaquit(Module* Creator) + : Command(Creator, "SAQUIT", 2, 2) + , servprotectmode(Creator, "servprotect") { access_needed = CmdAccess::OPERATOR; syntax = { "<nick> :<reason>" }; @@ -43,7 +48,7 @@ public: User* dest = ServerInstance->Users.Find(parameters[0]); if ((dest) && (dest->registered == REG_ALL)) { - if (dest->server->IsService()) + if (dest->IsModeSet(servprotectmode)) { user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a service"); return CmdResult::FAILURE; |
