]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_svshold.cpp
m_ssl_openssl Fix inverted check that prevented certificates from being recognized...
[user/henk/code/inspircd.git] / src / modules / m_svshold.cpp
index e27adf1e1b5878df317882a21560a18fbde9d32f..d8176043e8929244fa3b9f80066a0f285170867c 100644 (file)
@@ -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 <insane> 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));
        }