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_kick.h"
17 extern "C" DllExport Command* init_command(InspIRCd* Instance)
19 return new CommandKick(Instance);
24 CmdResult CommandKick::Handle (const char* const* parameters, int pcnt, User *user)
27 Channel* c = ServerInstance->FindChan(parameters[0]);
28 User* u = ServerInstance->FindNick(parameters[1]);
30 if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 1))
35 user->WriteServ( "401 %s %s :No such nick/channel", user->nick, u ? parameters[0] : parameters[1]);
39 if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server)))
41 user->WriteServ( "442 %s %s :You're not on that channel!", user->nick, parameters[0]);
47 strlcpy(reason, parameters[2], MAXKICK - 1);
51 strlcpy(reason, user->nick, MAXKICK - 1);
54 if (!c->KickUser(user, u, reason))
55 /* Nobody left here, delete the Channel */