]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/svspart.cpp
m_spanningtree: Ensure tags are sent in forwarded cmds
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / svspart.cpp
index 8e063394a9ec3c62f440bbba50b826de2a0e91fa..505a033e301efa137bf86be083128b643d41c7d0 100644 (file)
@@ -1,46 +1,46 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
  *
- * 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 <http://www.gnu.org/licenses/>.
  */
 
+
 #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<std::string>& 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<std::string>& 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]);
 }