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";
41 void Handle (char **parameters, int pcnt, userrec *user)
44 * NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send
45 * invalid or plain confusing mode changes, code some checking!
47 * - I'm not aware what checking I need, so for now... be supreme evil.
50 modes[0] = parameters[0];
52 modes[2] = user->nick;
54 Srv->SendMode(modes,3,user);
58 class ModuleDeVoice : public Module
60 cmd_devoice *mycommand;
62 ModuleDeVoice(Server* Me) : Module::Module(Me)
65 mycommand = new cmd_devoice();
66 Srv->AddCommand(mycommand);
69 virtual ~ModuleDeVoice()
73 virtual Version GetVersion()
75 return Version(1, 0, 0, 0, VF_VENDOR);
80 class ModuleDeVoiceFactory : public ModuleFactory
83 ModuleDeVoiceFactory()
87 ~ModuleDeVoiceFactory()
91 virtual Module * CreateModule(Server* Me)
93 return new ModuleDeVoice(Me);
99 extern "C" void * init_module( void )
101 return new ModuleDeVoiceFactory;