diff options
author | Adam <Adam@anope.org> | 2014-04-20 14:35:14 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-04-20 14:35:14 -0400 |
commit | 26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch) | |
tree | b9916f14fe35ce5c4de95c4194ca4ea0cb30812f /modules/commands/cs_topic.cpp | |
parent | 0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff) |
New event system
Diffstat (limited to 'modules/commands/cs_topic.cpp')
-rw-r--r-- | modules/commands/cs_topic.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 9b4752d20..2fd1b0a81 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -11,6 +11,8 @@ #include "module.h" #include "modules/cs_mode.h" +#include "modules/cs_info.h" +#include "modules/cs_set.h" class CommandCSSetKeepTopic : public Command { @@ -37,7 +39,7 @@ class CommandCSSetKeepTopic : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); + MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, params[1]); if (MOD_RESULT == EVENT_STOP) return; @@ -89,7 +91,7 @@ class CommandCSTopic : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, "topiclock on")); + MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, "topiclock on"); if (MOD_RESULT == EVENT_STOP) return; @@ -106,7 +108,7 @@ class CommandCSTopic : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, "topiclock off")); + MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, "topiclock off"); if (MOD_RESULT == EVENT_STOP) return; @@ -198,6 +200,9 @@ class CommandCSTopic : public Command }; class CSTopic : public Module + , public EventHook<Event::ChannelSync> + , public EventHook<Event::TopicUpdated> + , public EventHook<Event::ChanInfo> { CommandCSTopic commandcstopic; CommandCSSetKeepTopic commandcssetkeeptopic; @@ -205,8 +210,14 @@ class CSTopic : public Module SerializableExtensibleItem<bool> topiclock, keeptopic; public: - CSTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - commandcstopic(this), commandcssetkeeptopic(this), topiclock(this, "TOPICLOCK"), keeptopic(this, "KEEPTOPIC") + CSTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) + , EventHook<Event::ChannelSync>("OnChannelSync") + , EventHook<Event::TopicUpdated>("OnTopicUpdated") + , EventHook<Event::ChanInfo>("OnChanInfo") + , commandcstopic(this) + , commandcssetkeeptopic(this) + , topiclock(this, "TOPICLOCK") + , keeptopic(this, "KEEPTOPIC") { } |