1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 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. */
28 class cmd_devoice : public command_t
31 cmd_devoice (InspIRCd* Instance) : command_t(Instance,"DEVOICE", 0, 1)
33 this->source = "m_devoice.so";
37 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
39 chanrec* c = ServerInstance->FindChan(parameters[0]);
40 if (c && c->HasUser(user))
43 modes[0] = parameters[0];
45 modes[2] = user->nick;
47 userrec* n = new userrec(ServerInstance);
48 n->SetFd(FD_MAGIC_NUMBER);
49 ServerInstance->SendMode(modes,3,n);
60 class ModuleDeVoice : public Module
62 cmd_devoice *mycommand;
64 ModuleDeVoice(InspIRCd* Me) : Module(Me)
67 mycommand = new cmd_devoice(ServerInstance);
68 ServerInstance->AddCommand(mycommand);
71 virtual ~ModuleDeVoice()
75 virtual Version GetVersion()
77 return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
81 MODULE_INIT(ModuleDeVoice);