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(Module* Creator) : Command(Creator,"DEVOICE", 1)
31 TRANSLATE2(TR_TEXT, TR_END);
34 CmdResult Handle (const std::vector<std::string> ¶meters, User *user)
36 Channel* c = ServerInstance->FindChan(parameters[0]);
37 if (c && c->HasUser(user))
39 std::vector<std::string> modes;
40 modes.push_back(parameters[0]);
41 modes.push_back("-v");
42 modes.push_back(user->nick);
44 ServerInstance->SendMode(modes, ServerInstance->FakeClient);
45 ServerInstance->PI->SendMode(c->name, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
53 class ModuleDeVoice : public Module
57 ModuleDeVoice() : cmd(this)
59 ServerInstance->AddCommand(&cmd);
62 virtual ~ModuleDeVoice()
66 virtual Version GetVersion()
68 return Version("Provides voiced users with the ability to devoice themselves.", VF_VENDOR, API_VERSION);
72 MODULE_INIT(ModuleDeVoice)