]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/svspart.cpp
Update m_cloaking to use free-form keys instead of weakening the hash IV
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / svspart.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 "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 "treesocket.h"
23
24 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
25
26 bool TreeSocket::ServicePart(const std::string &prefix, parameterlist &params)
27 {
28         if (params.size() < 2)
29                 return true;
30
31         std::string reason = "Services forced part";
32
33         if (params.size() == 3)
34                 reason = params[2];
35
36         User* u = ServerInstance->FindNick(params[0]);
37         Channel* c = ServerInstance->FindChan(params[1]);
38
39         if (u)
40         {
41                 /* only part if it's local, otherwise just pass it on! */
42                 if (IS_LOCAL(u))
43                         if (!c->PartUser(u, reason))
44                                 delete c;
45                 Utils->DoOneToAllButSender(prefix,"SVSPART",params,prefix);
46         }
47
48         return true;
49 }
50