diff options
author | Adam <Adam@anope.org> | 2013-09-20 21:07:50 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-20 21:09:35 -0400 |
commit | e5ece18ee7804ed81f1b0f80af30a9aea8320522 (patch) | |
tree | 11ef551790936e22fb54122441fd152566ed0c17 /modules/commands/cs_topic.cpp | |
parent | 8641b995c43593289dc4e66cbf980069b80d6d6b (diff) |
Readonlyize many commands
Diffstat (limited to 'modules/commands/cs_topic.cpp')
-rw-r--r-- | modules/commands/cs_topic.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index fe393de65..95c83f154 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -23,6 +23,12 @@ class CommandCSSetKeepTopic : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { + if (Anope::ReadOnly) + { + source.Reply(READ_ONLY_MODE); + return; + } + ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) { @@ -76,6 +82,12 @@ class CommandCSTopic : public Command void Lock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { + if (Anope::ReadOnly) + { + source.Reply(READ_ONLY_MODE); + return; + } + EventReturn MOD_RESULT; FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, "topiclock on")); if (MOD_RESULT == EVENT_STOP) @@ -87,6 +99,12 @@ class CommandCSTopic : public Command void Unlock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { + if (Anope::ReadOnly) + { + source.Reply(READ_ONLY_MODE); + return; + } + EventReturn MOD_RESULT; FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, "topiclock off")); if (MOD_RESULT == EVENT_STOP) |