1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
20 * SAMODE module for InspIRCd
21 * Co authored by Brain and w00t
23 * Syntax: /SAMODE <#chan/nick> +/-<modes> [parameters for modes]
27 /* $ModDesc: Povides more advanced UnrealIRCd SAMODE command */
31 * Err... not a lot really.
43 class cmd_samode : public command_t
46 cmd_samode (InspIRCd* Instance) : command_t(Instance,"SAMODE", 'o', 2)
48 this->source = "m_samode.so";
49 syntax = "<target> <modes> {<mode-parameters>}";
52 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
55 * Handles an SAMODE request. Notifies all +s users.
58 userrec* n = new userrec(ServerInstance);
59 n->SetFd(FD_MAGIC_NUMBER);
60 ServerInstance->SendMode(parameters,pcnt,n);
63 if (ServerInstance->Modes->GetLastParse().length())
64 ServerInstance->WriteOpers(std::string(user->nick)+" used SAMODE: "+ServerInstance->Modes->GetLastParse());
70 class ModuleSaMode : public Module
72 cmd_samode* mycommand;
74 ModuleSaMode(InspIRCd* Me)
78 mycommand = new cmd_samode(ServerInstance);
79 ServerInstance->AddCommand(mycommand);
82 virtual ~ModuleSaMode()
86 virtual Version GetVersion()
88 return Version(1,0,2,2,VF_VENDOR,API_VERSION);
93 class ModuleSaModeFactory : public ModuleFactory
100 ~ModuleSaModeFactory()
104 virtual Module * CreateModule(InspIRCd* Me)
106 return new ModuleSaMode(Me);
112 extern "C" void * init_module( void )
114 return new ModuleSaModeFactory;