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 * DEVOICE module for InspIRCd
21 * Syntax: /DEVOICE <#chan>
24 /* $ModDesc: Provides voiced users with the ability to devoice themselves. */
33 class cmd_devoice : public command_t
36 cmd_devoice () : command_t("DEVOICE", 0, 1)
38 this->source = "m_devoice.so";
42 void Handle (const char** parameters, int pcnt, userrec *user)
45 * NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send
46 * invalid or plain confusing mode changes, code some checking!
48 * - I'm not aware what checking I need, so for now... be supreme evil.
51 modes[0] = parameters[0];
53 modes[2] = user->nick;
55 Srv->SendMode(modes,3,user);
59 class ModuleDeVoice : public Module
61 cmd_devoice *mycommand;
63 ModuleDeVoice(Server* Me) : Module::Module(Me)
66 mycommand = new cmd_devoice();
67 Srv->AddCommand(mycommand);
70 virtual ~ModuleDeVoice()
74 virtual Version GetVersion()
76 return Version(1, 0, 0, 0, VF_VENDOR);
81 class ModuleDeVoiceFactory : public ModuleFactory
84 ModuleDeVoiceFactory()
88 ~ModuleDeVoiceFactory()
92 virtual Module * CreateModule(Server* Me)
94 return new ModuleDeVoice(Me);
100 extern "C" void * module_init( void )
102 return new ModuleDeVoiceFactory;