]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/ping.cpp
Lower the acceptable drift for clocks on link.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / ping.cpp
index 92eee2666b68c1863dfd297e497fce785e51eb94..51e87874d202d952138da7ab438df1656291163e 100644 (file)
 #include "inspircd.h"
 
 #include "utils.h"
-#include "treesocket.h"
+#include "treeserver.h"
+#include "commands.h"
+#include "utils.h"
 
-bool TreeSocket::LocalPing(const std::string &prefix, parameterlist &params)
+CmdResult CommandPing::Handle(User* user, Params& params)
 {
-       if (params.size() < 1)
-               return true;
-
-       const std::string& forwardto = params[0];
-       if (forwardto == ServerInstance->Config->GetSID())
+       if (params[0] == ServerInstance->Config->GetSID())
        {
                // PING for us, reply with a PONG
-               std::string reply = ":" + forwardto + " PONG " + prefix;
+               CmdBuilder reply("PONG");
+               reply.push(user->uuid);
                if (params.size() >= 2)
                        // If there is a second parameter, append it
-                       reply.append(" :").append(params[1]);
+                       reply.push(params[1]);
 
-               this->WriteLine(reply);
-       }
-       else
-       {
-               // not for us, pass it on :)
-               Utils->DoOneToOne(prefix,"PING",params,forwardto);
+               reply.Unicast(user);
        }
-       return true;
+       return CMD_SUCCESS;
 }
-
-