1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
17 #include "treesocket.h"
18 #include "treeserver.h"
22 void TreeSocket::Encap(User* who, parameterlist ¶ms)
24 if (params.size() > 1)
26 if (ServerInstance->Config->GetSID() == params[0] || InspIRCd::Match(ServerInstance->Config->ServerName, params[0]))
28 parameterlist plist(params.begin() + 2, params.end());
29 ServerInstance->CallCommandHandler(params[1].c_str(), plist, who);
30 // discard return value, ENCAP shall succeed even if the command does not exist
33 params[params.size() - 1] = ":" + params[params.size() - 1];
35 if (params[0].find('*') != std::string::npos)
37 Utils->DoOneToAllButSender(who->uuid, "ENCAP", params, who->server);
40 Utils->DoOneToOne(who->uuid, "ENCAP", params, params[0]);