X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_kick.cpp;h=c11d934f9d7ab6bf8deb41e90ef7cb9626efc499;hb=b0e469b0bbdbc76692364e1f52ef613cc02a2a06;hp=fd098c4689a663556430948f8023f6b4a5ed2efa;hpb=1b7c615062a7b203c7fc3ce4c56e16eb671f7c15;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_kick.cpp b/src/cmd_kick.cpp index fd098c468..c11d934f9 100644 --- a/src/cmd_kick.cpp +++ b/src/cmd_kick.cpp @@ -2,12 +2,9 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. - * E-mail: - * - * + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits * - * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see * the file COPYING for details. * @@ -18,14 +15,14 @@ #include "inspircd.h" #include "commands/cmd_kick.h" - - extern "C" command_t* init_command(InspIRCd* Instance) { return new cmd_kick(Instance); } -void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user) +/** Handle /KICK + */ +CmdResult cmd_kick::Handle (const char** parameters, int pcnt, userrec *user) { char reason[MAXKICK]; chanrec* c = ServerInstance->FindChan(parameters[0]); @@ -34,13 +31,13 @@ void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user) if (!u || !c) { user->WriteServ( "401 %s %s :No such nick/channel", user->nick, u ? parameters[0] : parameters[1]); - return; + return CMD_FAILURE; } if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server))) { user->WriteServ( "442 %s %s :You're not on that channel!", user->nick, parameters[0]); - return; + return CMD_FAILURE; } if (pcnt > 2) @@ -55,4 +52,6 @@ void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user) if (!c->KickUser(user, u, reason)) /* Nobody left here, delete the chanrec */ delete c; + + return CMD_SUCCESS; }