]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/encap.cpp
Remove spanningtree override of /LUSERS
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / encap.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "xline.h"
16
17 #include "treesocket.h"
18 #include "treeserver.h"
19 #include "utils.h"
20
21 /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
22
23
24
25 /** ENCAP */
26 void TreeSocket::Encap(User* who, parameterlist &params)
27 {
28         if (params.size() > 1)
29         {
30                 if (InspIRCd::Match(ServerInstance->Config->GetSID(), params[0]))
31                 {
32                         parameterlist plist(params.begin() + 2, params.end());
33                         ServerInstance->CallCommandHandler(params[1].c_str(), plist, who);
34                         // discard return value, ENCAP shall succeed even if the command does not exist
35                 }
36                 
37                 params[params.size() - 1] = ":" + params[params.size() - 1];
38
39                 if (params[0].find('*') != std::string::npos)
40                 {
41                         Utils->DoOneToAllButSender(who->server, "ENCAP", params, who->server);
42                 }
43                 else
44                         Utils->DoOneToOne(who->server, "ENCAP", params, params[0]);
45         }
46 }
47