X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sakick.cpp;h=7dfcd8904db3b7e8531059e270274a6eac547cb5;hb=d0a472641b7c77fe5f40a6affb62de67be2ee888;hp=d8eda095641447158c1b37d3310273b270dfce72;hpb=069a2ef21425007d092342c8c11ec28da2f410d7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index d8eda0956..7dfcd8904 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 */ @@ -31,9 +38,8 @@ 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) + if ((dest) && (dest->registered == REG_ALL) && (channel)) { if (parameters.size() > 2) { @@ -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)) @@ -71,7 +76,7 @@ class CommandSakick : public Command if (IS_LOCAL(user)) { /* Locally issued command; send the snomasks */ - ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " SAKICKed " + dest->nick + " on " + parameters[0]); + ServerInstance->SNO->WriteGlobalSno('a', user->nick + " SAKICKed " + dest->nick + " on " + parameters[0]); } return CMD_SUCCESS; @@ -97,10 +102,14 @@ class ModuleSakick : public Module { CommandSakick cmd; public: - ModuleSakick(InspIRCd* Me) - : Module(Me), cmd(this) + ModuleSakick() + : cmd(this) + { + } + + void init() { - ServerInstance->AddCommand(&cmd); + ServerInstance->Modules->AddService(cmd); } virtual ~ModuleSakick() @@ -109,7 +118,7 @@ class ModuleSakick : public Module virtual Version GetVersion() { - return Version("$Id$", VF_OPTCOMMON|VF_VENDOR, API_VERSION); + return Version("Provides a SAKICK command", VF_OPTCOMMON|VF_VENDOR); } };