1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 /* $ModDesc: Provides a SATOPIC command */
20 class CommandSATopic : public Command
23 CommandSATopic (InspIRCd* Instance)
24 : Command(Instance,"SATOPIC", "o", 2, 2, false, 0)
26 this->source = "m_satopic.so";
27 syntax = "<target> <topic>";
30 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
33 * Handles a SATOPIC request. Notifies all +s users.
35 Channel* target = ServerInstance->FindChan(parameters[0]);
39 std::string newTopic = parameters[1];
41 // 3rd parameter overrides access checks
42 target->SetTopic(user, newTopic, true);
43 ServerInstance->SNO->WriteToSnoMask('A', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
44 ServerInstance->PI->SendSNONotice("A", user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
50 user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
56 class ModuleSATopic : public Module
58 CommandSATopic* mycommand;
60 ModuleSATopic(InspIRCd* Me)
63 mycommand = new CommandSATopic(ServerInstance);
64 ServerInstance->AddCommand(mycommand);
67 virtual ~ModuleSATopic()
71 virtual Version GetVersion()
73 return Version("$Id$", VF_VENDOR, API_VERSION);
77 MODULE_INIT(ModuleSATopic)