]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_samode.cpp
Call ModeParser::Process() directly instead of going through the CommandParser
[user/henk/code/inspircd.git] / src / modules / m_samode.cpp
index b91b602a688905acc6276218e3406f7e74ba4a3e..a549f89a7a6484b4840a01bb46f5d900e44a5f57 100644 (file)
@@ -20,8 +20,6 @@
  */
 
 
-/* $ModDesc: Provides command SAMODE to allow opers to change modes on channels and users */
-
 #include "inspircd.h"
 
 /** Handle /SAMODE
@@ -46,7 +44,7 @@ class CommandSamode : public Command
                                return CMD_FAILURE;
                }
                this->active = true;
-               ServerInstance->Parser->CallHandler("MODE", parameters, user);
+               ServerInstance->Modes->Process(parameters, user);
                if (ServerInstance->Modes->GetLastParse().length())
                        ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
                this->active = false;
@@ -63,18 +61,17 @@ class ModuleSaMode : public Module
        {
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
                ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->Attach(I_OnPreMode, this);
        }
 
-       Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides command SAMODE to allow opers to change modes on channels and users", VF_VENDOR);
        }
 
-       ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters)
+       ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters) CXX11_OVERRIDE
        {
                if (cmd.active)
                        return MOD_RES_ALLOW;