diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/commands/cs_topic.cpp | 10 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 10 |
2 files changed, 18 insertions, 2 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> ¶ms) { + 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> ¶ms) { + 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()); } diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 2a21b9643..bbe069466 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -755,8 +755,14 @@ class ProtoInspIRCd : public Module EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) anope_override { - if (cmd->name == "chanserv/set/topiclock" && ci->c) - SendChannelMetadata(ci->c, "topiclock", setting.equals_ci("ON") ? "1" : ""); + if (cmd->name == "chanserv/topic" && ci->c) + { + + if (setting == "topiclock on") + SendChannelMetadata(ci->c, "topiclock", "1"); + else if (setting == "topiclock off") + SendChannelMetadata(ci->c, "topiclock", "0"); + } return EVENT_CONTINUE; } |