1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 /* $ModDesc: Provides more advanced UnrealIRCd SAMODE command */
20 class CommandSamode : public Command
23 CommandSamode (InspIRCd* Instance) : Command(Instance,"SAMODE", "o", 2, false, 0)
25 this->source = "m_samode.so";
26 syntax = "<target> <modes> {<mode-parameters>}";
29 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
32 * Handles an SAMODE request. Notifies all +s users.
34 ServerInstance->SendMode(parameters, ServerInstance->FakeClient);
36 if (ServerInstance->Modes->GetLastParse().length())
38 ServerInstance->SNO->WriteToSnoMask('A', std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse());
40 std::string channel = parameters[0];
41 ServerInstance->PI->SendMode(channel, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
47 user->WriteServ("NOTICE %s :*** Invalid SAMODE sequence.", user->nick.c_str());
54 class ModuleSaMode : public Module
56 CommandSamode* mycommand;
58 ModuleSaMode(InspIRCd* Me)
62 mycommand = new CommandSamode(ServerInstance);
63 ServerInstance->AddCommand(mycommand);
67 virtual ~ModuleSaMode()
71 virtual Version GetVersion()
73 return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
77 MODULE_INIT(ModuleSaMode)