]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/num.cpp
Fix a bunch of weird indentation and spacing issues.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / num.cpp
index 2c8697c9a5b6b64704db6fd8a3cd1a435fd954c8..2d7c484e1b61749b742252f6ad1d265a79c27564 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
@@ -23,7 +24,7 @@
 #include "commands.h"
 #include "remoteuser.h"
 
-CmdResult CommandNum::HandleServer(TreeServer* server, std::vector<std::string>& params)
+CmdResult CommandNum::HandleServer(TreeServer* server, CommandBase::Params& params)
 {
        User* const target = ServerInstance->FindUUID(params[1]);
        if (!target)
@@ -33,7 +34,7 @@ CmdResult CommandNum::HandleServer(TreeServer* server, std::vector<std::string>&
        if (!localtarget)
                return CMD_SUCCESS;
 
-       Numeric::Numeric numeric(ConvToInt(params[2]));
+       Numeric::Numeric numeric(ConvToNum<unsigned int>(params[2]));
        // Passing NULL is ok, in that case the numeric source becomes this server
        numeric.SetServer(Utils->FindServerID(params[0]));
        numeric.GetParams().insert(numeric.GetParams().end(), params.begin()+3, params.end());
@@ -42,7 +43,7 @@ CmdResult CommandNum::HandleServer(TreeServer* server, std::vector<std::string>&
        return CMD_SUCCESS;
 }
 
-RouteDescriptor CommandNum::GetRouting(User* user, const std::vector<std::string>& params)
+RouteDescriptor CommandNum::GetRouting(User* user, const Params& params)
 {
        return ROUTE_UNICAST(params[1]);
 }
@@ -51,11 +52,11 @@ CommandNum::Builder::Builder(SpanningTree::RemoteUser* target, const Numeric::Nu
        : CmdBuilder("NUM")
 {
        TreeServer* const server = (numeric.GetServer() ? (static_cast<TreeServer*>(numeric.GetServer())) : Utils->TreeRoot);
-       push(server->GetID()).push(target->uuid).push(InspIRCd::Format("%03u", numeric.GetNumeric()));
-       const std::vector<std::string>& params = numeric.GetParams();
+       push(server->GetId()).push(target->uuid).push(InspIRCd::Format("%03u", numeric.GetNumeric()));
+       const CommandBase::Params& params = numeric.GetParams();
        if (!params.empty())
        {
-               for (std::vector<std::string>::const_iterator i = params.begin(); i != params.end()-1; ++i)
+               for (CommandBase::Params::const_iterator i = params.begin(); i != params.end()-1; ++i)
                        push(*i);
                push_last(params.back());
        }