1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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 std::vector<std::string> ¶meters, User *user)
37 Channel* c = ServerInstance->FindChan(parameters[0]);
38 if (c && c->HasUser(user))
40 std::vector<std::string> modes;
41 modes.push_back(parameters[0]);
42 modes.push_back("-v");
43 modes.push_back(user->nick);
45 ServerInstance->SendMode(modes, 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("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
77 MODULE_INIT(ModuleDeVoice)