X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_samode.cpp;h=9b71992a60888f04f8b27652d7b0e77b725e9048;hb=9cdf47629faeec64edc77ff0729dc55946ed753c;hp=d9c75adf79d394520f8501acff5582ce400a723c;hpb=eadffd640b96414f208c9bed4c290031811a764e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index d9c75adf7..9b71992a6 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -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 = " {}"; 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); }