]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_devoice.cpp
PROPAGATE this fix
[user/henk/code/inspircd.git] / src / modules / m_devoice.cpp
index 7c1ffe9656a5e078d3bb63305d99462385093208..f2c47cc9afe22e27e2990b17edf631314489101b 100644 (file)
@@ -19,9 +19,6 @@
 /* $ModDesc: Provides voiced users with the ability to devoice themselves. */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /** Handle /DEVOICE
  */
@@ -32,6 +29,7 @@ class cmd_devoice : public command_t
        {
                this->source = "m_devoice.so";
                syntax = "<channel>";
+               TRANSLATE2(TR_TEXT, TR_END);
        }
 
        CmdResult Handle (const char** parameters, int pcnt, userrec *user)
@@ -44,12 +42,9 @@ class cmd_devoice : public command_t
                        modes[1] = "-v";
                        modes[2] = user->nick;
 
-                       userrec* n = new userrec(ServerInstance);
-                       n->SetFd(FD_MAGIC_NUMBER);
-                       ServerInstance->SendMode(modes,3,n);
-                       delete n;
+                       ServerInstance->SendMode(modes, 3, ServerInstance->FakeClient);
 
-                       /* route it */
+                       /* route it -- SendMode doesn't distribute over the whole network */
                        return CMD_SUCCESS;
                }
 
@@ -74,8 +69,8 @@ class ModuleDeVoice : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };
 
-MODULE_INIT(ModuleDeVoice);
+MODULE_INIT(ModuleDeVoice)