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 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
45 chanrec* c = ServerInstance->FindChan(parameters[0]);
46 if (c && c->HasUser(user))
49 modes[0] = parameters[0];
51 modes[2] = user->nick;
53 ServerInstance->SendMode(modes,3,user);
62 class ModuleDeVoice : public Module
64 cmd_devoice *mycommand;
66 ModuleDeVoice(InspIRCd* Me) : Module::Module(Me)
69 mycommand = new cmd_devoice(ServerInstance);
70 ServerInstance->AddCommand(mycommand);
73 virtual ~ModuleDeVoice()
77 virtual Version GetVersion()
79 return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
84 class ModuleDeVoiceFactory : public ModuleFactory
87 ModuleDeVoiceFactory()
91 ~ModuleDeVoiceFactory()
95 virtual Module * CreateModule(InspIRCd* Me)
97 return new ModuleDeVoice(Me);
103 extern "C" void * init_module( void )
105 return new ModuleDeVoiceFactory;