]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_devoice.cpp
Fix memory leak and invalid vtable location on unload of m_sslinfo
[user/henk/code/inspircd.git] / src / modules / m_devoice.cpp
index ba12d7db977819d2c74d305b7a83e2a5032960d1..0d511886c02e3d3e51092439986a41fafd916ef3 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -25,9 +25,8 @@
 class CommandDevoice : public Command
 {
  public:
-       CommandDevoice (InspIRCd* Instance) : Command(Instance,"DEVOICE", 0, 1)
+       CommandDevoice (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"DEVOICE", 0, 1)
        {
-               this->source = "m_devoice.so";
                syntax = "<channel>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -43,9 +42,8 @@ class CommandDevoice : public Command
                        modes.push_back(user->nick);
 
                        ServerInstance->SendMode(modes, ServerInstance->FakeClient);
-
-                       /* route it -- SendMode doesn't distribute over the whole network */
-                       return CMD_SUCCESS;
+                       ServerInstance->PI->SendMode(c->name, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
+                       return CMD_LOCALONLY;
                }
 
                return CMD_FAILURE;
@@ -54,14 +52,11 @@ class CommandDevoice : public Command
 
 class ModuleDeVoice : public Module
 {
-       CommandDevoice *mycommand;
+       CommandDevoice cmd;
  public:
-       ModuleDeVoice(InspIRCd* Me) : Module(Me)
+       ModuleDeVoice(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
-
-               mycommand = new CommandDevoice(ServerInstance);
-               ServerInstance->AddCommand(mycommand);
-
+               ServerInstance->AddCommand(&cmd);
        }
 
        virtual ~ModuleDeVoice()
@@ -70,7 +65,7 @@ class ModuleDeVoice : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_VENDOR, API_VERSION);
        }
 };