X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_devoice.cpp;h=4e4b3a354b4efdb0bd7bf8c97584b36e61498251;hb=43b5073d6f80a8dcb7044ecd127fd5893da033ab;hp=3405794662eb5b8efccfe8895f401c1496d6f302;hpb=4b41feea830fc84e8c1b2fd0982f3e8d8840af96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index 340579466..4e4b3a354 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -24,8 +24,6 @@ * Syntax: /DEVOICE <#chan> */ -/* $ModDesc: Provides voiced users with the ability to devoice themselves. */ - #include "inspircd.h" /** Handle /DEVOICE @@ -36,24 +34,17 @@ class CommandDevoice : public Command CommandDevoice(Module* Creator) : Command(Creator,"DEVOICE", 1) { syntax = ""; - TRANSLATE2(TR_TEXT, TR_END); } CmdResult Handle (const std::vector ¶meters, User *user) { - Channel* c = ServerInstance->FindChan(parameters[0]); - if (c && c->HasUser(user)) - { - std::vector modes; - modes.push_back(parameters[0]); - modes.push_back("-v"); - modes.push_back(user->nick); - - ServerInstance->SendGlobalMode(modes, ServerInstance->FakeClient); - return CMD_SUCCESS; - } + std::vector modes; + modes.push_back(parameters[0]); + modes.push_back("-v"); + modes.push_back(user->nick); - return CMD_FAILURE; + ServerInstance->Parser.CallHandler("MODE", modes, ServerInstance->FakeClient); + return CMD_SUCCESS; } }; @@ -65,11 +56,6 @@ class ModuleDeVoice : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Provides voiced users with the ability to devoice themselves.", VF_VENDOR);