From 889d521e05f2e922683d48c74eb00290e7a2f548 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 17 Jul 2024 00:06:50 +0100 Subject: Shuffle the modules about a bit. --- src/modules/m_saquit.cpp | 93 ------------------------------------------------ 1 file changed, 93 deletions(-) delete mode 100644 src/modules/m_saquit.cpp (limited to 'src/modules/m_saquit.cpp') diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp deleted file mode 100644 index bd9de35b8..000000000 --- a/src/modules/m_saquit.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * InspIRCd -- Internet Relay Chat Daemon - * - * Copyright (C) 2019-2023 Sadie Powell - * Copyright (C) 2016 Attila Molnar - * Copyright (C) 2012, 2019 Robby - * Copyright (C) 2009 Thomas Stagner - * Copyright (C) 2009 Daniel De Graaf - * Copyright (C) 2008 Robin Burchell - * Copyright (C) 2007 John Brooks - * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2007 Craig Edwards - * - * This file is part of InspIRCd. InspIRCd is free software: you can - * redistribute it and/or modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#include "inspircd.h" - -class CommandSaquit final - : public Command -{ -private: - UserModeReference servprotectmode; - -public: - CommandSaquit(Module* Creator) - : Command(Creator, "SAQUIT", 2, 2) - , servprotectmode(Creator, "servprotect") - { - access_needed = CmdAccess::OPERATOR; - syntax = { " :" }; - translation = { TR_NICK, TR_TEXT }; - } - - CmdResult Handle(User* user, const Params& parameters) override - { - auto* dest = ServerInstance->Users.Find(parameters[0], true); - if (dest) - { - if (dest->IsModeSet(servprotectmode)) - { - user->WriteNumeric(ERR_NOPRIVILEGES, "Cannot use an SA command on a service"); - return CmdResult::FAILURE; - } - - // Pass the command on, so the client's server can quit it properly. - if (!IS_LOCAL(dest)) - return CmdResult::SUCCESS; - - ServerInstance->SNO.WriteGlobalSno('a', user->nick+" used SAQUIT to make "+dest->nick+" quit with a reason of "+parameters[1]); - - ServerInstance->Users.QuitUser(dest, parameters[1]); - return CmdResult::SUCCESS; - } - else - { - user->WriteNotice("*** Invalid nickname: '" + parameters[0] + "'"); - return CmdResult::FAILURE; - } - } - - RouteDescriptor GetRouting(User* user, const Params& parameters) override - { - return ROUTE_OPT_UCAST(parameters[0]); - } -}; - -class ModuleSaquit final - : public Module -{ -private: - CommandSaquit cmd; - -public: - ModuleSaquit() - : Module(VF_VENDOR | VF_OPTCOMMON, "Adds the /SAQUIT command which allows server operators to disconnect users from the server.") - , cmd(this) - { - } -}; - -MODULE_INIT(ModuleSaquit) -- cgit v1.3.1-10-gc9f91