X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_devoice.cpp;h=0e6f68480d295ef1a98c56f05f0a26f8dcf5f58e;hb=8cebe2878f3878afce6f643d93668155cb26801d;hp=f2c47cc9afe22e27e2990b17edf631314489101b;hpb=67b09fde7b19fbf63b419b7ee42cc4be910ddcf1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index f2c47cc9a..0e6f68480 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 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. @@ -22,30 +22,29 @@ /** Handle /DEVOICE */ -class cmd_devoice : public command_t +class CommandDevoice : public Command { public: - cmd_devoice (InspIRCd* Instance) : command_t(Instance,"DEVOICE", 0, 1) + CommandDevoice (InspIRCd* Instance) : Command(Instance,"DEVOICE", 0, 1) { this->source = "m_devoice.so"; syntax = ""; TRANSLATE2(TR_TEXT, TR_END); } - CmdResult Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const std::vector ¶meters, User *user) { - chanrec* c = ServerInstance->FindChan(parameters[0]); + Channel* c = ServerInstance->FindChan(parameters[0]); if (c && c->HasUser(user)) { - const char* modes[3]; - modes[0] = parameters[0]; - modes[1] = "-v"; - modes[2] = user->nick; + std::vector modes; + modes.push_back(parameters[0]); + modes.push_back("-v"); + modes.push_back(user->nick); - ServerInstance->SendMode(modes, 3, ServerInstance->FakeClient); - - /* route it -- SendMode doesn't distribute over the whole network */ - return CMD_SUCCESS; + ServerInstance->SendMode(modes, ServerInstance->FakeClient); + ServerInstance->PI->SendMode(c->name, ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate()); + return CMD_LOCALONLY; } return CMD_FAILURE; @@ -54,13 +53,11 @@ class cmd_devoice : public command_t class ModuleDeVoice : public Module { - cmd_devoice *mycommand; + CommandDevoice cmd; public: - ModuleDeVoice(InspIRCd* Me) : Module(Me) + ModuleDeVoice(InspIRCd* Me) : Module(Me), cmd(Me) { - - mycommand = new cmd_devoice(ServerInstance); - ServerInstance->AddCommand(mycommand); + ServerInstance->AddCommand(&cmd); } virtual ~ModuleDeVoice() @@ -69,7 +66,7 @@ class ModuleDeVoice : public Module virtual Version GetVersion() { - return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_VENDOR, API_VERSION); } };