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.
41 class cmd_samode : public command_t
44 cmd_samode () : command_t("SAMODE", 'o', 2)
46 this->source = "m_samode.so";
49 void Handle (const char** parameters, int pcnt, userrec *user)
52 * Handles an SAMODE request. Notifies all +s users.
55 Srv->Log(DEBUG,"SAMODE: Being handled");
56 Srv->SendMode(parameters,pcnt,user);
57 Srv->Log(DEBUG,"SAMODE: Modechange handled");
58 result = std::string(user->nick);
59 result.append(" used SAMODE");
60 for (int n = 0; n < pcnt; n++)
63 result.append(parameters[n]);
65 Srv->SendOpers(result);
69 class ModuleSaMode : public Module
71 cmd_samode* mycommand;
73 ModuleSaMode(Server* Me)
77 mycommand = new cmd_samode();
78 Srv->AddCommand(mycommand);
81 virtual ~ModuleSaMode()
85 virtual Version GetVersion()
87 return Version(1,0,2,2,VF_VENDOR);
92 class ModuleSaModeFactory : public ModuleFactory
99 ~ModuleSaModeFactory()
103 virtual Module * CreateModule(Server* Me)
105 return new ModuleSaMode(Me);
111 extern "C" void * init_module( void )
113 return new ModuleSaModeFactory;