]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/svsnick.cpp
Update m_cloaking to use free-form keys instead of weakening the hash IV
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / svsnick.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 /** Because Andy insists that services-compatible servers must
27  * implement SVSNICK and SVSJOIN, that's exactly what we do :p
28  */
29 bool TreeSocket::SVSNick(const std::string &prefix, parameterlist &params)
30 {
31         if (params.size() < 3)
32                 return true;
33
34         User* u = ServerInstance->FindNick(params[0]);
35
36         if (u)
37         {
38                 Utils->DoOneToAllButSender(prefix,"SVSNICK",params,prefix);
39
40                 if (IS_LOCAL(u))
41                 {
42                         parameterlist par;
43                         par.push_back(params[1]);
44
45                         if (!u->ForceNickChange(params[1].c_str()))
46                         {
47                                 /* buh. UID them */
48                                 if (!u->ForceNickChange(u->uuid.c_str()))
49                                 {
50                                         ServerInstance->Users->QuitUser(u, "Nickname collision");
51                                         return true;
52                                 }
53                         }
54
55                         u->age = atoi(params[2].c_str());
56                 }
57         }
58
59         return true;
60 }
61