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";
47 syntax = "<target> <modes> {<mode-parameters>}";
50 void Handle (const char** parameters, int pcnt, userrec *user)
53 * Handles an SAMODE request. Notifies all +s users.
56 Srv->Log(DEBUG,"SAMODE: Being handled");
57 userrec* n = new userrec();
58 n->fd = FD_MAGIC_NUMBER;
59 Srv->SendMode(parameters,pcnt,n);
61 Srv->Log(DEBUG,"SAMODE: Modechange handled");
62 result = std::string(user->nick);
63 result.append(" used SAMODE");
64 for (int n = 0; n < pcnt; n++)
67 result.append(parameters[n]);
69 Srv->SendOpers(result);
73 class ModuleSaMode : public Module
75 cmd_samode* mycommand;
77 ModuleSaMode(Server* Me)
81 mycommand = new cmd_samode();
82 Srv->AddCommand(mycommand);
85 virtual ~ModuleSaMode()
89 virtual Version GetVersion()
91 return Version(1,0,2,2,VF_VENDOR);
96 class ModuleSaModeFactory : public ModuleFactory
103 ~ModuleSaModeFactory()
107 virtual Module * CreateModule(Server* Me)
109 return new ModuleSaMode(Me);
115 extern "C" void * init_module( void )
117 return new ModuleSaModeFactory;