2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2008 Oliver Lupton <oliverlupton@gmail.com>
6 * This file is part of InspIRCd. InspIRCd is free software: you can
7 * redistribute it and/or modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation, version 2.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 class CommandSATopic : public Command
27 CommandSATopic(Module* Creator) : Command(Creator,"SATOPIC", 2, 2)
29 flags_needed = 'o'; Penalty = 0; syntax = "<target> <topic>";
32 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
35 * Handles a SATOPIC request. Notifies all +s users.
37 Channel* target = ServerInstance->FindChan(parameters[0]);
41 const std::string& newTopic = parameters[1];
42 target->SetTopic(user, newTopic);
43 ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
49 user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[0].c_str());
55 class ModuleSATopic : public Module
64 Version GetVersion() CXX11_OVERRIDE
66 return Version("Provides a SATOPIC command", VF_VENDOR);
70 MODULE_INIT(ModuleSATopic)