1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 * DEVOICE module for InspIRCd
16 * Syntax: /DEVOICE <#chan>
19 /* $ModDesc: Provides voiced users with the ability to devoice themselves. */
25 class CommandDevoice : public Command
28 CommandDevoice (InspIRCd* Instance) : Command(Instance,"DEVOICE", 0, 1)
30 this->source = "m_devoice.so";
32 TRANSLATE2(TR_TEXT, TR_END);
35 CmdResult Handle (const char* const* parameters, int pcnt, User *user)
37 Channel* c = ServerInstance->FindChan(parameters[0]);
38 if (c && c->HasUser(user))
41 modes[0] = parameters[0];
43 modes[2] = user->nick;
45 ServerInstance->SendMode(modes, 3, ServerInstance->FakeClient);
47 /* route it -- SendMode doesn't distribute over the whole network */
55 class ModuleDeVoice : public Module
57 CommandDevoice *mycommand;
59 ModuleDeVoice(InspIRCd* Me) : Module(Me)
62 mycommand = new CommandDevoice(ServerInstance);
63 ServerInstance->AddCommand(mycommand);
67 virtual ~ModuleDeVoice()
71 virtual Version GetVersion()
73 return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
77 MODULE_INIT(ModuleDeVoice)