X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fsvspart.cpp;h=505a033e301efa137bf86be083128b643d41c7d0;hb=ee7db9bbfbb5f3bc7359d22e7021415aebddb9d2;hp=4d73c50bb488e625c768c95c32146f45e7ce38b8;hpb=e2289d4cf4f9a9c587c1956c089bb3a32a48b54d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/svspart.cpp b/src/modules/m_spanningtree/svspart.cpp index 4d73c50bb..505a033e3 100644 --- a/src/modules/m_spanningtree/svspart.cpp +++ b/src/modules/m_spanningtree/svspart.cpp @@ -1,46 +1,46 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2010 Daniel De Graaf + * Copyright (C) 2008 Robin Burchell * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" -#include "socket.h" -#include "xline.h" -#include "socketengine.h" -#include "main.h" -#include "utils.h" -#include "treeserver.h" #include "commands.h" -CmdResult CommandSVSPart::Handle(const std::vector& parameters, User *user) +CmdResult CommandSVSPart::Handle(User* user, Params& parameters) { - std::string reason = "Services forced part"; + User* u = ServerInstance->FindUUID(parameters[0]); + if (!u) + return CMD_FAILURE; - if (parameters.size() == 3) - reason = parameters[2]; - - User* u = ServerInstance->FindNick(parameters[0]); Channel* c = ServerInstance->FindChan(parameters[1]); + if (!c) + return CMD_FAILURE; - if (u && IS_LOCAL(u)) + if (IS_LOCAL(u)) + { + std::string reason = (parameters.size() == 3) ? parameters[2] : "Services forced part"; c->PartUser(u, reason); - + } return CMD_SUCCESS; } -RouteDescriptor CommandSVSPart::GetRouting(User* user, const std::vector& parameters) +RouteDescriptor CommandSVSPart::GetRouting(User* user, const Params& parameters) { - User* u = ServerInstance->FindNick(parameters[0]); - if (u) - return ROUTE_OPT_UCAST(u->server); - return ROUTE_LOCALONLY; + return ROUTE_OPT_UCAST(parameters[0]); }