X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_devoice.cpp;h=4dcca3d9d65346589a56f748c1bacd5069d7e678;hb=d54fd9b1e6b31f69332a9241b5f17330c0ad61e0;hp=70d510b9ae493a3a17436cbf912029e9abde0176;hpb=b0cb12952a378d4d3717d3a5556325a15be1de0a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index 70d510b9a..4dcca3d9d 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. + * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. * E-mail: * * @@ -27,18 +27,20 @@ using namespace std; #include "users.h" #include "channels.h" #include "modules.h" +#include "inspircd.h" + -Server *Srv; class cmd_devoice : public command_t { public: - cmd_devoice () : command_t("DEVOICE", 'o', 2) + cmd_devoice (InspIRCd* Instance) : command_t(Instance,"DEVOICE", 0, 1) { this->source = "m_devoice.so"; + syntax = ""; } - 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]; - modes[0] = parameters[0]; - modes[1] = "-v"; - modes[2] = user->nick; + 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); }