summaryrefslogtreecommitdiff
path: root/modules/commands/cs_set.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_set.cpp
parentc7a22dff878cc517a34d36767df0edd77fd72c09 (diff)
Put appendtopic and topiclock into /cs topic
Diffstat (limited to 'modules/commands/cs_set.cpp')
-rw-r--r--modules/commands/cs_set.cpp59
1 files changed, 1 insertions, 58 deletions
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index ecd228877..5ac235c8f 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -1084,62 +1084,6 @@ class CommandCSSetSuccessor : public Command
}
};
-class CommandCSSetTopicLock : public Command
-{
- public:
- CommandCSSetTopicLock(Module *creator, const Anope::string &cname = "chanserv/set/topiclock") : Command(creator, cname, 2, 2)
- {
- this->SetDesc(_("Topic can only be changed with TOPIC"));
- this->SetSyntax(_("\037channel\037 {ON | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- ChannelInfo *ci = ChannelInfo::Find(params[0]);
- if (ci == NULL)
- {
- source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
- return;
- }
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
- if (params[1].equals_ci("ON"))
- {
- ci->SetFlag(CI_TOPICLOCK);
- source.Reply(_("Topic lock option for %s is now \002on\002."), ci->name.c_str());
- }
- else if (params[1].equals_ci("OFF"))
- {
- ci->UnsetFlag(CI_TOPICLOCK);
- source.Reply(_("Topic lock option for %s is now \002off\002."), ci->name.c_str());
- }
- else
- this->OnSyntaxError(source, "TOPICLOCK");
-
- return;
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Enables or disables the \002topic lock\002 option for a channel.\n"
- "When \002topic lock\002 is set, the channel topic will be unchangable\n"
- "except via the \002TOPIC\002 command."));
- return true;
- }
-};
-
class CommandCSSASetNoexpire : public Command
{
public:
@@ -1210,7 +1154,6 @@ class CSSet : public Module
CommandCSSetSecureOps commandcssetsecureops;
CommandCSSetSignKick commandcssetsignkick;
CommandCSSetSuccessor commandcssetsuccessor;
- CommandCSSetTopicLock commandcssettopiclock;
CommandCSSASetNoexpire commandcssasetnoexpire;
public:
@@ -1219,7 +1162,7 @@ class CSSet : public Module
CSDefChanstats(false), commandcssetdescription(this), commandcssetfounder(this), commandcssetkeeptopic(this),
commandcssetpeace(this), commandcssetpersist(this), commandcssetprivate(this), commandcssetrestricted(this),
commandcssetsecure(this), commandcssetsecurefounder(this), commandcssetsecureops(this), commandcssetsignkick(this),
- commandcssetsuccessor(this), commandcssettopiclock(this), commandcssasetnoexpire(this)
+ commandcssetsuccessor(this), commandcssasetnoexpire(this)
{
this->SetAuthor("Anope");