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 * ---------------------------------------------------
18 #include "m_spanningtree/treesocket.h"
19 #include "m_spanningtree/treeserver.h"
20 #include "m_spanningtree/utils.h"
22 /* $ModDep: m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
26 bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> ¶ms)
28 if (params.size() != 2)
31 User* who = this->ServerInstance->FindNick(params[0]);
35 /* Prepend kill source, if we don't have one */
36 if (*(params[1].c_str()) != 'K')
38 params[1] = "Killed (" + params[1] +")";
40 std::string reason = params[1];
41 params[1] = ":" + params[1];
42 Utils->DoOneToAllButSender(prefix,"KILL",params,prefix);
43 // NOTE: This is safe with kill hiding on, as RemoteKill is only reached if we have a server prefix.
44 // in short this is not executed for USERS.
45 who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick.c_str(), prefix.c_str(), reason.c_str());
46 this->ServerInstance->Users->QuitUser(who, reason);