X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_spanningtree%2Fping.cpp;h=df4d920735e7286ba67f73b5db783ba0bd2b0c5a;hb=e2b0f3dc9ef4d56c71d7abda13e6139ca092e387;hp=badcc340162ed1f09645745ee8ec1637bc522463;hpb=2f17664ea13fe8f0983080d69886a46b58e5e266;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/ping.cpp b/src/modules/m_spanningtree/ping.cpp index badcc3401..df4d92073 100644 --- a/src/modules/m_spanningtree/ping.cpp +++ b/src/modules/m_spanningtree/ping.cpp @@ -1,6 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2018-2019 Sadie Powell + * Copyright (C) 2013 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2010 Craig Edwards + * Copyright (C) 2009 Daniel De Graaf * Copyright (C) 2008 Robin Burchell * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -20,32 +25,22 @@ #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 ¶ms) +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; } - -