1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_whois.h"
16 #include "commands/cmd_stats.h"
19 #include "transport.h"
20 #include "socketengine.h"
22 #include "m_spanningtree/main.h"
23 #include "m_spanningtree/utils.h"
24 #include "m_spanningtree/treeserver.h"
25 #include "m_spanningtree/treesocket.h"
27 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
29 /** Because Andy insists that services-compatible servers must
30 * implement SVSNICK and SVSJOIN, that's exactly what we do :p
32 bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> ¶ms)
34 if (params.size() < 3)
37 User* u = this->ServerInstance->FindNick(params[0]);
41 Utils->DoOneToAllButSender(prefix,"SVSNICK",params,prefix);
45 std::deque<std::string> par;
46 par.push_back(params[1]);
48 if (!u->ForceNickChange(params[1].c_str()))
51 if (!u->ForceNickChange(u->uuid.c_str()))
53 this->ServerInstance->Users->QuitUser(u, "Nickname collision");
58 u->age = atoi(params[2].c_str());