From 7922b96408a4908c9ebba363cb9ca63dd195e178 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 10 May 2022 15:16:21 +0100 Subject: Use the servprotect mode to protect services. Anope and Atheme already set this on their clients so no downstream changes are needed. Closes #781. --- src/modules/m_saquit.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/modules/m_saquit.cpp') 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 = { " :" }; @@ -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; -- cgit v1.3.1-10-gc9f91