X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_svshold.cpp;h=d8176043e8929244fa3b9f80066a0f285170867c;hb=561f4f642e5bc391300dd33989c3624986808ed8;hp=e27adf1e1b5878df317882a21560a18fbde9d32f;hpb=84a1569cd60daa64b1ae52a1fff62c0dc4d78850;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index e27adf1e1..d8176043e 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -32,7 +32,7 @@ class SVSHold : public XLine public: irc::string nickname; - SVSHold(time_t s_time, long d, std::string src, std::string re, std::string nick) + SVSHold(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& nick) : XLine(s_time, d, src, re, "SVSHOLD") { this->nickname = nick.c_str(); @@ -123,6 +123,9 @@ class CommandSvshold : public Command } else { + if (parameters.size() < 3) + return CMD_FAILURE; + // Adding - XXX todo make this respect tag perhaps.. long duration = ServerInstance->Duration(parameters[1]); SVSHold* r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str()); @@ -170,7 +173,7 @@ class ModuleSVSHold : public Module void init() { ServerInstance->XLines->RegisterFactory(&s); - ServerInstance->AddCommand(&cmd); + ServerInstance->Modules->AddService(cmd); Implementation eventlist[] = { I_OnUserPreNick, I_OnStats }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); }