X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_part.cpp;h=347466c22375dda74d6850c615bd4d2b7f299a27;hb=0306a4231e85baeb5029ef2b9b36d0b5d241d147;hp=9fd01d058114d273e192f068d3886165c662ee2b;hpb=1b7c615062a7b203c7fc3ce4c56e16eb671f7c15;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_part.cpp b/src/cmd_part.cpp index 9fd01d058..347466c22 100644 --- a/src/cmd_part.cpp +++ b/src/cmd_part.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,28 +15,29 @@ #include "users.h" #include "commands/cmd_part.h" - - -extern "C" command_t* init_command(InspIRCd* Instance) +extern "C" DllExport command_t* init_command(InspIRCd* Instance) { return new cmd_part(Instance); } -void cmd_part::Handle (const char** parameters, int pcnt, userrec *user) +CmdResult cmd_part::Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) - return; + return CMD_SUCCESS; chanrec* c = ServerInstance->FindChan(parameters[0]); if (c) { - if (!c->PartUser(user, pcnt > 1 ? parameters[0] : NULL)) + if (!c->PartUser(user, pcnt > 1 ? parameters[1] : NULL)) /* Arse, who stole our channel! :/ */ delete c; } else { user->WriteServ( "401 %s %s :No such channel", user->nick, parameters[0]); + return CMD_FAILURE; } + + return CMD_SUCCESS; }