]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/ping.cpp
Add support for blocking tag messages with the deaf mode.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / ping.cpp
index badcc340162ed1f09645745ee8ec1637bc522463..df4d920735e7286ba67f73b5db783ba0bd2b0c5a 100644 (file)
@@ -1,6 +1,11 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
  *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
 #include "inspircd.h"
 
 #include "utils.h"
-#include "treesocket.h"
-
-/* $ModDep: m_spanningtree/utils.h m_spanningtree/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);
+               reply.Unicast(user);
        }
-       else
-       {
-               // not for us, pass it on :)
-               Utils->DoOneToOne(prefix,"PING",params,forwardto);
-       }
-       return true;
+       return CMD_SUCCESS;
 }
-
-