X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_part.cpp;h=54fd1321667c7eec4552b3e259340bec4d66d8a5;hb=436fad2bf0fb122470a47a1453fa24b446104a8f;hp=5137a32cabc9493f7aa666846319e9bf336aa4b0;hpb=e4acbc95b8b6cd5b28d38a2242c02e8ff4991e4a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index 5137a32ca..54fd13216 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -19,7 +19,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPart(Instance); } -CmdResult CommandPart::Handle (const char** parameters, int pcnt, User *user) +CmdResult CommandPart::Handle (const std::vector& parameters, User *user) { std::string reason; @@ -29,7 +29,7 @@ CmdResult CommandPart::Handle (const char** parameters, int pcnt, User *user) reason = ServerInstance->Config->FixedPart; else { - if (pcnt > 1) + if (parameters.size() > 1) reason = ServerInstance->Config->PrefixPart + std::string(parameters[1]) + ServerInstance->Config->SuffixPart; else reason = ""; @@ -37,24 +37,23 @@ CmdResult CommandPart::Handle (const char** parameters, int pcnt, User *user) } else { - reason = pcnt ? parameters[1] : ""; + reason = parameters.size() > 1 ? parameters[1] : ""; } - if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) + if (ServerInstance->Parser->LoopCall(user, this, parameters, 0)) return CMD_SUCCESS; Channel* c = ServerInstance->FindChan(parameters[0]); if (c) { - const char *rreason = reason.empty() ? NULL : reason.c_str(); - if (!c->PartUser(user, rreason)) + if (!c->PartUser(user, reason)) /* Arse, who stole our channel! :/ */ delete c; } else { - user->WriteServ( "401 %s %s :No such channel", user->nick, parameters[0]); + user->WriteServ( "401 %s %s :No such channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; }