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
24 CommandSamode (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SAMODE", "o", 2, false, 0)
26 syntax = "<target> <modes> {<mode-parameters>}";
30 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
33 ServerInstance->Parser->CallHandler("MODE", parameters, user);
34 if (ServerInstance->Modes->GetLastParse().length())
35 ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
41 class ModuleSaMode : public Module
45 ModuleSaMode(InspIRCd* Me)
46 : Module(Me), cmd(Me, this)
48 ServerInstance->AddCommand(&cmd);
49 ServerInstance->Modules->Attach(I_OnAccessCheck, this);
52 virtual ~ModuleSaMode()
56 virtual Version GetVersion()
58 return Version("$Id$", VF_VENDOR, API_VERSION);
61 virtual ModResult OnAccessCheck(User* source,User* dest,Channel* channel,int access_type)
65 return MOD_RES_PASSTHRU;
70 Module *override = ServerInstance->Modules->Find("m_override.so");
71 ServerInstance->Modules->SetPriority(this, I_OnAccessCheck, PRIORITY_BEFORE, &override);
75 MODULE_INIT(ModuleSaMode)