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.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp
index 2b5de2bd6..e16a87336 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,12 @@ class ModuleDeVoice : public Module
{
}
- void init()
+ void init() CXX11_OVERRIDE
{
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);
}