X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sakick.cpp;h=2cb1f2a0449f1f521e7e8c69c34b4eb19a5b5f66;hb=6c2edc2c5ab07a1fa8c32d3fa9abd6b9149b804c;hp=860f181324b2344a76c5fa8eb3c7e0373c83a796;hpb=24731c63b6320be22f7b3220236271fa7476b975;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 860f18132..2cb1f2a04 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -1,16 +1,23 @@ -/* +------------------------------------+ - * | 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) 2009 John Brooks + * Copyright (C) 2009 Daniel De Graaf * - * 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" /* $ModDesc: Provides a SAKICK command */ @@ -20,9 +27,9 @@ class CommandSakick : public Command { public: - CommandSakick (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SAKICK", "o", 2, 3, false, 0) + CommandSakick(Module* Creator) : Command(Creator,"SAKICK", 2, 3) { - syntax = " [reason]"; + flags_needed = 'o'; Penalty = 0; syntax = " [reason]"; TRANSLATE4(TR_TEXT, TR_NICK, TR_TEXT, TR_END); } @@ -31,7 +38,6 @@ class CommandSakick : public Command User* dest = ServerInstance->FindNick(parameters[1]); Channel* channel = ServerInstance->FindChan(parameters[0]); const char* reason = ""; - const char* servername = NULL; if (dest && channel) { @@ -56,8 +62,7 @@ class CommandSakick : public Command */ if (IS_LOCAL(dest)) { - if (!channel->ServerKickUser(dest, reason, servername)) - delete channel; + channel->KickUser(ServerInstance->FakeClient, dest, reason); Channel *n = ServerInstance->FindChan(parameters[1]); if (n && n->HasUser(dest)) @@ -83,14 +88,22 @@ class CommandSakick : public Command return CMD_FAILURE; } + + RouteDescriptor GetRouting(User* user, const std::vector& parameters) + { + User* dest = ServerInstance->FindNick(parameters[1]); + if (dest) + return ROUTE_OPT_UCAST(dest->server); + return ROUTE_LOCALONLY; + } }; class ModuleSakick : public Module { CommandSakick cmd; public: - ModuleSakick(InspIRCd* Me) - : Module(Me), cmd(Me, this) + ModuleSakick() + : cmd(this) { ServerInstance->AddCommand(&cmd); } @@ -101,7 +114,7 @@ class ModuleSakick : public Module virtual Version GetVersion() { - return Version("$Id$", VF_COMMON|VF_VENDOR, API_VERSION); + return Version("Provides a SAKICK command", VF_OPTCOMMON|VF_VENDOR); } };