From 0e758a2ac23dc4a001e8e126cec14588da9a9769 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 28 Jul 2016 21:29:35 -0400 Subject: 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 --- include/modules/nickserv/suspend.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'include/modules/nickserv/suspend.h') diff --git a/include/modules/nickserv/suspend.h b/include/modules/nickserv/suspend.h index fcfc0265d..2cd8faab6 100644 --- a/include/modules/nickserv/suspend.h +++ b/include/modules/nickserv/suspend.h @@ -12,6 +12,8 @@ class NSSuspendInfo : public Serialize::Object using Serialize::Object::Object; public: + static constexpr const char *const NAME = "nssuspendinfo"; + virtual NickServ::Account *GetAccount() anope_abstract; virtual void SetAccount(NickServ::Account *) anope_abstract; @@ -28,12 +30,14 @@ class NSSuspendInfo : public Serialize::Object virtual void SetExpires(const time_t &) anope_abstract; }; -static Serialize::TypeReference nssuspendinfo("NSSuspendInfo"); - namespace Event { struct CoreExport NickSuspend : Events { + static constexpr const char *NAME = "nicksuspend"; + + using Events::Events; + /** Called when a nick is suspended * @param na The nick alias */ @@ -42,12 +46,13 @@ namespace Event struct CoreExport NickUnsuspend : Events { + static constexpr const char *NAME = "nickunsuspend"; + + using Events::Events; + /** Called when a nick is unsuspneded * @param na The nick alias */ virtual void OnNickUnsuspend(NickServ::Nick *na) anope_abstract; }; } - -template<> struct EventName { static constexpr const char *const name = "OnNickSuspend"; }; -template<> struct EventName { static constexpr const char *const name = "OnNickUnsuspend"; }; -- cgit