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"
20 #include "helperfuncs.h"
21 #include "commands/cmd_kick.h"
23 void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user)
26 chanrec* c = FindChan(parameters[0]);
27 userrec* u = Find(parameters[1]);
31 WriteServ(user->fd, "401 %s %s :No such nick/channel", user->nick, u ? parameters[0] : parameters[1]);
35 if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!is_uline(user->server)))
37 WriteServ(user->fd, "442 %s %s :You're not on that channel!", user->nick, parameters[0]);
43 strlcpy(reason, parameters[2], MAXKICK - 1);
47 strlcpy(reason, user->nick, MAXKICK - 1);
50 kick_channel(user, u, c, reason);