1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_whois.h"
16 #include "commands/cmd_stats.h"
19 #include "transport.h"
20 #include "socketengine.h"
22 #include "m_spanningtree/main.h"
23 #include "m_spanningtree/utils.h"
24 #include "m_spanningtree/treeserver.h"
25 #include "m_spanningtree/link.h"
26 #include "m_spanningtree/treesocket.h"
28 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
30 bool TreeSocket::Stats(const std::string &prefix, std::deque<std::string> ¶ms)
32 /* Get the reply to a STATS query if it matches this servername,
33 * and send it back as a load of PUSH queries
35 if (params.size() > 1)
37 if (InspIRCd::Match(this->ServerInstance->Config->ServerName, params[1]))
39 /* It's for our server */
41 User* source = this->ServerInstance->FindNick(prefix);
44 std::deque<std::string> par;
45 par.push_back(prefix);
47 DoStats(this->ServerInstance, *(params[0].c_str()), source, results);
48 for (size_t i = 0; i < results.size(); i++)
50 par[1] = "::" + results[i];
51 Utils->DoOneToOne(this->ServerInstance->Config->GetSID(), "PUSH",par, source->server);
58 User* source = this->ServerInstance->FindNick(prefix);
60 Utils->DoOneToOne(source->uuid, "STATS", params, params[1]);