1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #include "inspircd_config.h"
22 #include "commands/cmd_kick.h"
26 void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user)
29 chanrec* c = ServerInstance->FindChan(parameters[0]);
30 userrec* u = ServerInstance->FindNick(parameters[1]);
34 user->WriteServ( "401 %s %s :No such nick/channel", user->nick, u ? parameters[0] : parameters[1]);
38 if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server)))
40 user->WriteServ( "442 %s %s :You're not on that channel!", user->nick, parameters[0]);
46 strlcpy(reason, parameters[2], MAXKICK - 1);
50 strlcpy(reason, user->nick, MAXKICK - 1);
53 if (!c->KickUser(user, u, reason))
54 /* Nobody left here, delete the chanrec */