summaryrefslogtreecommitdiff
path: root/modules/commands/cs_appendtopic.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-27 09:43:19 -0500
committerAdam <Adam@anope.org>2012-12-27 09:43:19 -0500
commit7b1ae9602d0aa3053814c7d1e6f460860f5180e0 (patch)
tree27245ce4d1754ac3fe294dbb5bfe3c42b599280c /modules/commands/cs_appendtopic.cpp
parentc7a22dff878cc517a34d36767df0edd77fd72c09 (diff)
Put appendtopic and topiclock into /cs topic
Diffstat (limited to 'modules/commands/cs_appendtopic.cpp')
-rw-r--r--modules/commands/cs_appendtopic.cpp111
1 files changed, 0 insertions, 111 deletions
diff --git a/modules/commands/cs_appendtopic.cpp b/modules/commands/cs_appendtopic.cpp
deleted file mode 100644
index 2d7c0f278..000000000
--- a/modules/commands/cs_appendtopic.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/* cs_appendtopic.c - Add text to a channels topic
- *
- * (C) 2003-2012 Anope Team
- * Contact us at team@anope.org
- *
- * Based on the original module by SGR <Alex_SGR@ntlworld.com>
- * Included in the Anope module pack since Anope 1.7.9
- * Anope Coder: GeniusDex <geniusdex@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Send bug reports to the Anope Coder instead of the module
- * author, because any changes since the inclusion into anope
- * are not supported by the original author.
- */
-
-/*************************************************************************/
-
-#include "module.h"
-
-/* ------------------------------------------------------------
- * Name: cs_appendtopic
- * Author: SGR <Alex_SGR@ntlworld.com>
- * Date: 31/08/2003
- * ------------------------------------------------------------
- *
- * This module has no configurable options. For information on
- * this module, load it and refer to /ChanServ APPENDTOPIC HELP
- *
- * Thanks to dengel, Rob and Certus for all there support.
- * Especially Rob, who always manages to show me where I have
- * not allocated any memory. Even if it takes a few weeks of
- * pestering to get him to look at it.
- *
- * ------------------------------------------------------------
- */
-
-/* ---------------------------------------------------------------------- */
-/* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */
-/* ---------------------------------------------------------------------- */
-
-class CommandCSAppendTopic : public Command
-{
- public:
- CommandCSAppendTopic(Module *creator) : Command(creator, "chanserv/appendtopic", 2, 2)
- {
- this->SetDesc(_("Add text to a channels topic"));
- this->SetSyntax(_("\037channel\037 \037text\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- const Anope::string &newtopic = params[1];
-
- Channel *c = Channel::Find(params[0]);;
-
- if (!c)
- source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str());
- else if (!c->ci)
- source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str());
- else if (!source.AccessFor(c->ci).HasPriv("TOPIC") && !source.HasCommand("chanserv/topic"))
- source.Reply(ACCESS_DENIED);
- else
- {
- Anope::string topic;
- if (!c->ci->last_topic.empty())
- {
- topic = c->ci->last_topic + " " + newtopic;
- c->ci->last_topic.clear();
- }
- else
- topic = newtopic;
-
- bool has_topiclock = c->ci->HasFlag(CI_TOPICLOCK);
- c->ci->UnsetFlag(CI_TOPICLOCK);
- c->ChangeTopic(source.GetNick(), topic, Anope::CurTime);
- if (has_topiclock)
- c->ci->SetFlag(CI_TOPICLOCK);
-
- bool override = !source.AccessFor(c->ci).HasPriv("TOPIC");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, c->ci) << "to append: " << topic;
- }
- return;
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("This command allows users to append text to a currently set\n"
- "channel topic. When TOPICLOCK is on, the topic is updated and\n"
- "the new, updated topic is locked."));
-
- return true;
- }
-};
-
-class CSAppendTopic : public Module
-{
- CommandCSAppendTopic commandcsappendtopic;
-
- public:
- CSAppendTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandcsappendtopic(this)
- {
- this->SetAuthor("SGR");
-
- }
-};
-
-MODULE_INIT(CSAppendTopic)