diff options
author | Adam <Adam@anope.org> | 2016-07-28 21:29:35 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-07-28 21:29:35 -0400 |
commit | 0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch) | |
tree | 45df813323e023c5c89db7279426c4ad0943b4a9 /modules/chanserv/topic.cpp | |
parent | a3c8afae00c54d5b95c620248b51f90679d7d53f (diff) |
Allow serializable fields to use storage in the respective objects.
Split service management code nito a proper servicemanager. Make service
references managed instead of lazy lookup. Also made events and
serializable use service manager instead of their respective systems for
management
Diffstat (limited to 'modules/chanserv/topic.cpp')
-rw-r--r-- | modules/chanserv/topic.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/chanserv/topic.cpp b/modules/chanserv/topic.cpp index aab3f8dbf..6559b4d25 100644 --- a/modules/chanserv/topic.cpp +++ b/modules/chanserv/topic.cpp @@ -42,7 +42,7 @@ class CommandCSSetKeepTopic : public Command } EventReturn MOD_RESULT; - MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, param); + MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, param); if (MOD_RESULT == EVENT_STOP) return; @@ -90,7 +90,7 @@ class CommandCSTopic : public Command } EventReturn MOD_RESULT; - MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, "topiclock on"); + MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, "topiclock on"); if (MOD_RESULT == EVENT_STOP) return; @@ -107,7 +107,7 @@ class CommandCSTopic : public Command } EventReturn MOD_RESULT; - MOD_RESULT = Event::OnSetChannelOption(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, "topiclock off"); + MOD_RESULT = EventManager::Get()->Dispatch(&Event::SetChannelOption::OnSetChannelOption, source, this, ci, "topiclock off"); if (MOD_RESULT == EVENT_STOP) return; @@ -211,10 +211,15 @@ class CSTopic : public Module CommandCSTopic commandcstopic; CommandCSSetKeepTopic commandcssetkeeptopic; - /*Serializable*/ExtensibleItem<bool> topiclock, keeptopic; + Serialize::Field<ChanServ::Channel, bool> topiclock, keeptopic; + + ServiceReference<ModeLocks> mlocks; public: CSTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) + , EventHook<Event::ChannelSync>(this) + , EventHook<Event::TopicUpdated>(this) + , EventHook<Event::ChanInfo>(this) , commandcstopic(this) , commandcssetkeeptopic(this) , topiclock(this, "TOPICLOCK") |