summaryrefslogtreecommitdiff
path: root/src/modules/m_devoice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_devoice.cpp')
-rw-r--r--src/modules/m_devoice.cpp32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp
index 2b5de2bd6..901f77b1a 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 = "<channel>";
- TRANSLATE2(TR_TEXT, TR_END);
}
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
- Channel* c = ServerInstance->FindChan(parameters[0]);
- if (c && c->HasUser(user))
- {
- std::vector<std::string> 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<std::string> modes;
+ modes.push_back(parameters[0]);
+ modes.push_back("-v");
+ modes.push_back(user->nick);
- return CMD_FAILURE;
+ ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
+ return CMD_SUCCESS;
}
};
@@ -65,16 +56,7 @@ class ModuleDeVoice : public Module
{
}
- void init()
- {
- ServerInstance->Modules->AddService(cmd);
- }
-
- virtual ~ModuleDeVoice()
- {
- }
-
- virtual Version GetVersion()
+ Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides voiced users with the ability to devoice themselves.", VF_VENDOR);
}