]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/svspart.cpp
...because every now and again, i have to do a massive commit.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / svspart.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2010 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 "socket.h"
16 #include "xline.h"
17 #include "socketengine.h"
18
19 #include "main.h"
20 #include "utils.h"
21 #include "treeserver.h"
22 #include "commands.h"
23
24 CmdResult CommandSVSPart::Handle(const std::vector<std::string>& parameters, User *user)
25 {
26         std::string reason = "Services forced part";
27
28         if (parameters.size() == 3)
29                 reason = parameters[2];
30
31         User* u = ServerInstance->FindNick(parameters[0]);
32         Channel* c = ServerInstance->FindChan(parameters[1]);
33
34         if (u && IS_LOCAL(u))
35                 c->PartUser(u, reason);
36
37         return CMD_SUCCESS;
38 }
39
40 RouteDescriptor CommandSVSPart::GetRouting(User* user, const std::vector<std::string>& parameters)
41 {
42         User* u = ServerInstance->FindNick(parameters[0]);
43         if (u)
44                 return ROUTE_OPT_UCAST(u->server);
45         return ROUTE_LOCALONLY;
46 }