]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/addline.cpp
Fix conversion issues by replacing ConvToInt with ConvToNum<T>.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / addline.cpp
index dbf0003bf6fa5f8f373c551005bbcb026b68a3bb..623942d953edd35caa6fb1f317aabfee246fd124 100644 (file)
 #include "utils.h"
 #include "commands.h"
 
-CmdResult CommandAddLine::Handle(User* usr, std::vector<std::string>& params)
+CmdResult CommandAddLine::Handle(User* usr, Params& params)
 {
        XLineFactory* xlf = ServerInstance->XLines->GetFactory(params[0]);
        const std::string& setter = usr->nick;
 
        if (!xlf)
        {
-               ServerInstance->SNO->WriteToSnoMask('d',"%s sent me an unknown ADDLINE type (%s).",setter.c_str(),params[0].c_str());
+               ServerInstance->SNO->WriteToSnoMask('x',"%s sent me an unknown ADDLINE type (%s).",setter.c_str(),params[0].c_str());
                return CMD_FAILURE;
        }
 
        XLine* xl = NULL;
        try
        {
-               xl = xlf->Generate(ServerInstance->Time(), ConvToInt(params[4]), params[2], params[5], params[1]);
+               xl = xlf->Generate(ServerInstance->Time(), ConvToNum<long>(params[4]), params[2], params[5], params[1]);
        }
        catch (ModuleException &e)
        {
-               ServerInstance->SNO->WriteToSnoMask('d',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason().c_str());
+               ServerInstance->SNO->WriteToSnoMask('x',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason().c_str());
                return CMD_FAILURE;
        }
-       xl->SetCreateTime(ConvToInt(params[3]));
+       xl->SetCreateTime(ConvToNum<time_t>(params[3]));
        if (ServerInstance->XLines->AddLine(xl, NULL))
        {
                if (xl->duration)
@@ -62,7 +62,7 @@ CmdResult CommandAddLine::Handle(User* usr, std::vector<std::string>& params)
 
                TreeServer* remoteserver = TreeServer::Get(usr);
 
-               if (!remoteserver->bursting)
+               if (!remoteserver->IsBursting())
                {
                        ServerInstance->XLines->ApplyLines();
                }