]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_samode.cpp
m_spanningtree When an IOHook goes away close all pending connections that use it
[user/henk/code/inspircd.git] / src / modules / m_samode.cpp
index d9c75adf79d394520f8501acff5582ce400a723c..9b71992a60888f04f8b27652d7b0e77b725e9048 100644 (file)
@@ -32,6 +32,7 @@ class CommandSamode : public Command
        bool active;
        CommandSamode(Module* Creator) : Command(Creator,"SAMODE", 2)
        {
+               allow_empty_last_param = false;
                flags_needed = 'o'; Penalty = 0; syntax = "<target> <modes> {<mode-parameters>}";
                active = false;
        }
@@ -41,7 +42,7 @@ class CommandSamode : public Command
                this->active = true;
                ServerInstance->Parser->CallHandler("MODE", parameters, user);
                if (ServerInstance->Modes->GetLastParse().length())
-                       ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
+                       ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
                this->active = false;
                return CMD_SUCCESS;
        }
@@ -54,7 +55,11 @@ class ModuleSaMode : public Module
        ModuleSaMode()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(cmd);
                ServerInstance->Modules->Attach(I_OnPreMode, this);
        }