X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_satopic.cpp;h=4a6f855369276dba2b3fb6fd865571e0454a9713;hb=43b5073d6f80a8dcb7044ecd127fd5893da033ab;hp=7b2c3e5ebc07cd8db625e12cff61e1f66edee54a;hpb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 7b2c3e5eb..4a6f85536 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -1,17 +1,21 @@ -/* +------------------------------------+ - * | 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) 2008 Oliver Lupton * - * 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 . */ -/* $ModDesc: Provides a SATOPIC command */ #include "inspircd.h" @@ -34,18 +38,15 @@ class CommandSATopic : public Command if(target) { - std::string newTopic = parameters[1]; - - // 3rd parameter overrides access checks - target->SetTopic(user, newTopic, true); - ServerInstance->SNO->WriteToSnoMask('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic); - ServerInstance->PI->SendSNONotice("A", user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic); + const std::string& newTopic = parameters[1]; + target->SetTopic(user, newTopic); + ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic); return CMD_SUCCESS; } else { - user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str()); return CMD_FAILURE; } } @@ -57,17 +58,12 @@ class ModuleSATopic : public Module public: ModuleSATopic() : cmd(this) - { - ServerInstance->AddCommand(&cmd); - } - - virtual ~ModuleSATopic() { } - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { - return Version("Provides a SATOPIC command", VF_VENDOR, API_VERSION); + return Version("Provides a SATOPIC command", VF_VENDOR); } };