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. */
34 class cmd_devoice : public command_t
37 cmd_devoice (InspIRCd* Instance) : command_t(Instance,"DEVOICE", 0, 1)
39 this->source = "m_devoice.so";
43 void Handle (const char** parameters, int pcnt, userrec *user)
46 * NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send
47 * invalid or plain confusing mode changes, code some checking!
49 * - I'm not aware what checking I need, so for now... be supreme evil.
52 modes[0] = parameters[0];
54 modes[2] = user->nick;
56 ServerInstance->SendMode(modes,3,user);
60 class ModuleDeVoice : public Module
62 cmd_devoice *mycommand;
64 ModuleDeVoice(InspIRCd* Me) : Module::Module(Me)
67 mycommand = new cmd_devoice(ServerInstance);
68 ServerInstance->AddCommand(mycommand);
71 virtual ~ModuleDeVoice()
75 virtual Version GetVersion()
77 return Version(1, 0, 0, 0, VF_VENDOR);
82 class ModuleDeVoiceFactory : public ModuleFactory
85 ModuleDeVoiceFactory()
89 ~ModuleDeVoiceFactory()
93 virtual Module * CreateModule(InspIRCd* Me)
95 return new ModuleDeVoice(Me);
101 extern "C" void * init_module( void )
103 return new ModuleDeVoiceFactory;