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: Provides more advanced UnrealIRCd SAMODE command */
31 * Err... not a lot really.
42 class cmd_samode : public command_t
45 cmd_samode (InspIRCd* Instance) : command_t(Instance,"SAMODE", 'o', 2)
47 this->source = "m_samode.so";
48 syntax = "<target> <modes> {<mode-parameters>}";
51 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
54 * Handles an SAMODE request. Notifies all +s users.
57 userrec* n = new userrec(ServerInstance);
58 n->SetFd(FD_MAGIC_NUMBER);
59 ServerInstance->SendMode(parameters,pcnt,n);
62 if (ServerInstance->Modes->GetLastParse().length())
63 ServerInstance->WriteOpers(std::string(user->nick)+" used SAMODE: "+ServerInstance->Modes->GetLastParse());
69 class ModuleSaMode : public Module
71 cmd_samode* mycommand;
73 ModuleSaMode(InspIRCd* Me)
77 mycommand = new cmd_samode(ServerInstance);
78 ServerInstance->AddCommand(mycommand);
81 virtual ~ModuleSaMode()
85 virtual Version GetVersion()
87 return Version(1,1,2,2,VF_VENDOR,API_VERSION);
92 class ModuleSaModeFactory : public ModuleFactory
99 ~ModuleSaModeFactory()
103 virtual Module * CreateModule(InspIRCd* Me)
105 return new ModuleSaMode(Me);
111 extern "C" void * init_module( void )
113 return new ModuleSaModeFactory;