1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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(Module* Creator) : Command(Creator,"SATOPIC", 2, 2)
25 flags_needed = 'o'; Penalty = 0; syntax = "<target> <topic>";
28 CmdResult Handle (const std::vector<std::string>& parameters, User *user)
31 * Handles a SATOPIC request. Notifies all +s users.
33 Channel* target = ServerInstance->FindChan(parameters[0]);
37 std::string newTopic = parameters[1];
39 // 3rd parameter overrides access checks
40 target->SetTopic(user, newTopic, true);
41 ServerInstance->SNO->WriteToSnoMask('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
42 ServerInstance->PI->SendSNONotice("A", user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
48 user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
54 class ModuleSATopic : public Module
58 ModuleSATopic(InspIRCd* Me)
59 : Module(Me), cmd(this)
61 ServerInstance->AddCommand(&cmd);
64 virtual ~ModuleSATopic()
68 virtual Version GetVersion()
70 return Version("$Id$", VF_VENDOR, API_VERSION);
74 MODULE_INIT(ModuleSATopic)