2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
6 * Copyright (C) 2006-2007 Robin Burchell <robin+git@viroteck.net>
7 * Copyright (C) 2004-2005 Craig Edwards <craigedwards@brainbox.cc>
9 * This file is part of InspIRCd. InspIRCd is free software: you can
10 * redistribute it and/or modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation, version 2.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 /* $ModDesc: Provides command SAMODE to allow opers to change modes on channels and users */
29 class CommandSamode : public Command
33 CommandSamode(Module* Creator) : Command(Creator,"SAMODE", 2)
35 flags_needed = 'o'; Penalty = 0; syntax = "<target> <modes> {<mode-parameters>}";
39 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
42 ServerInstance->Parser->CallHandler("MODE", parameters, user);
43 if (ServerInstance->Modes->GetLastParse().length())
44 ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
50 class ModuleSaMode : public Module
61 ServerInstance->Modules->AddService(cmd);
62 ServerInstance->Modules->Attach(I_OnPreMode, this);
71 return Version("Provides command SAMODE to allow opers to change modes on channels and users", VF_VENDOR);
74 ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters)
78 return MOD_RES_PASSTHRU;
83 Module *override = ServerInstance->Modules->Find("m_override.so");
84 ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_BEFORE, &override);
88 MODULE_INIT(ModuleSaMode)