]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_devoice.cpp
Wahhhhhhhhhhhh bwahahaha. Mass commit to tidy up tons of messy include lists
[user/henk/code/inspircd.git] / src / modules / m_devoice.cpp
index 75bc4c4f395d5feb7bf445efc61eb25cddbe80d5..4dcca3d9d65346589a56f748c1bacd5069d7e678 100644 (file)
@@ -27,18 +27,20 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
+#include "inspircd.h"
+
 
-static Server *Srv;
         
 class cmd_devoice : public command_t
 {
  public:
      cmd_devoice () : command_t("DEVOICE", 0, 1)
cmd_devoice (InspIRCd* Instance) : command_t(Instance,"DEVOICE", 0, 1)
        {
                this->source = "m_devoice.so";
+               syntax = "<channel>";
        }
 
-       void Handle (char **parameters, int pcnt, userrec *user)
+       void Handle (const char** parameters, int pcnt, userrec *user)
        {
                /*
                 * NOTE: DO NOT CODE LIKE THIS!!! This has no checks and can send
@@ -46,12 +48,12 @@ class cmd_devoice : public command_t
                 *
                 * - I'm not aware what checking I need, so for now... be supreme evil.
                 */
-               char* modes[3];
+               const char* modes[3];
                modes[0] = parameters[0];
                modes[1] = "-v";
                modes[2] = user->nick;
 
-               Srv->SendMode(modes,3,user);
+               ServerInstance->SendMode(modes,3,user);
        }
 };
 
@@ -59,11 +61,11 @@ class ModuleDeVoice : public Module
 {
        cmd_devoice *mycommand;
  public:
-       ModuleDeVoice(Server* Me) : Module::Module(Me)
+       ModuleDeVoice(InspIRCd* Me) : Module::Module(Me)
        {
-               Srv = Me;
-               mycommand = new cmd_devoice();
-               Srv->AddCommand(mycommand);
+               
+               mycommand = new cmd_devoice(ServerInstance);
+               ServerInstance->AddCommand(mycommand);
        }
        
        virtual ~ModuleDeVoice()
@@ -88,7 +90,7 @@ class ModuleDeVoiceFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule(Server* Me)
+       virtual Module * CreateModule(InspIRCd* Me)
        {
                return new ModuleDeVoice(Me);
        }
@@ -96,7 +98,7 @@ class ModuleDeVoiceFactory : public ModuleFactory
 };
 
 
-extern "C" void * devoice_init( void )
+extern "C" void * init_module( void )
 {
        return new ModuleDeVoiceFactory;
 }