summaryrefslogtreecommitdiff
path: root/modules/commands/cs_topic.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-04-06 15:26:52 -0500
committerAdam <Adam@anope.org>2013-04-06 15:26:52 -0500
commit0b3b9fe128e63c836ff08c637735068564470b8e (patch)
treef4ab4798c658227623929c524a59ab404621fd3f /modules/commands/cs_topic.cpp
parentf71c7865fc41387d36cc1d854a5f9c40bd5ae48d (diff)
Fix toggling topiclock when the channel setting is changed
Diffstat (limited to 'modules/commands/cs_topic.cpp')
-rw-r--r--modules/commands/cs_topic.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp
index 8b55a2da4..c98c5c958 100644
--- a/modules/commands/cs_topic.cpp
+++ b/modules/commands/cs_topic.cpp
@@ -15,12 +15,22 @@ class CommandCSTopic : public Command
{
void Lock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
{
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, "topiclock on"));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
ci->ExtendMetadata("TOPICLOCK");
source.Reply(_("Topic lock option for %s is now \002on\002."), ci->name.c_str());
}
void Unlock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
{
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, "topiclock off"));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
ci->Shrink("TOPICLOCK");
source.Reply(_("Topic lock option for %s is now \002off\002."), ci->name.c_str());
}