diff options
| author | Adam <Adam@anope.org> | 2014-12-10 01:29:18 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-12-10 01:29:18 -0500 |
| commit | 3e5a5e1c669f6027b897f7358d45f92e1552f746 (patch) | |
| tree | 5be9d41890d79eb0472f374b3f2a0ab9b36b1941 /include | |
| parent | 42238034490fb5479d787bd1695750387d508200 (diff) | |
Use a triat class for event names instead of having to manually give them places, which is much less error prone
Diffstat (limited to 'include')
28 files changed, 158 insertions, 19 deletions
diff --git a/include/event.h b/include/event.h index a8c8999cd..1cc39a67e 100644 --- a/include/event.h +++ b/include/event.h @@ -59,6 +59,9 @@ struct Caller<EventHandler, Func, EventReturn, Args...> } }; +template<typename T> +struct EventName; + template<typename EventHandler> class EventHook; @@ -69,7 +72,7 @@ class EventHandlers : public Service friend class EventHook<EventHandler>; public: - EventHandlers(Module *o, const Anope::string &ename) : Service(o, "EventHandlers", ename) + EventHandlers(Module *o) : Service(o, "EventHandlers", EventName<EventHandler>::name) { } @@ -85,7 +88,7 @@ class EventHandlersReference { ServiceReference<EventHandlers<EventHandler>> ref; public: - EventHandlersReference(const Anope::string &name) : ref("EventHandlers", name) { } + EventHandlersReference() : ref("EventHandlers", EventName<EventHandler>::name) { } explicit operator bool() { @@ -131,7 +134,7 @@ class EventHook : public EventHandler } priority; - EventHook(const Anope::string &name, Priority p = Priority::LAST) : handlers(this, name), priority(p) + EventHook(Priority p = Priority::LAST) : handlers(this, EventName<EventHandler>::name), priority(p) { handlers.Check(); } @@ -1013,3 +1016,88 @@ namespace Event extern CoreExport EventHandlers<SerializeEvents> OnSerialize; } +template<> struct EventName<Event::PreUserKicked> { static constexpr const char *const name = "OnPreUserKicked"; }; +template<> struct EventName<Event::UserKicked> { static constexpr const char *const name = "OnUserKicked"; }; +template<> struct EventName<Event::PreBotAssign> { static constexpr const char *const name = "OnPreBotAssign"; }; +template<> struct EventName<Event::BotAssign> { static constexpr const char *const name = "OnBotAssign"; }; +template<> struct EventName<Event::BotUnAssign> { static constexpr const char *const name = "OnBotUnAssign"; }; +template<> struct EventName<Event::UserConnect> { static constexpr const char *const name = "OnUserConnect"; }; +template<> struct EventName<Event::NewServer> { static constexpr const char *const name = "OnNewServer"; }; +template<> struct EventName<Event::UserNickChange> { static constexpr const char *const name = "OnUserNickChange"; }; +template<> struct EventName<Event::PreCommand> { static constexpr const char *const name = "OnPreCommand"; }; +template<> struct EventName<Event::PostCommand> { static constexpr const char *const name = "OnPostCommand"; }; +template<> struct EventName<Event::SaveDatabase> { static constexpr const char *const name = "OnSaveDatabase"; }; +template<> struct EventName<Event::LoadDatabase> { static constexpr const char *const name = "OnLoadDatabase"; }; +template<> struct EventName<Event::Encrypt> { static constexpr const char *const name = "OnEncrypt"; }; +template<> struct EventName<Event::Decrypt> { static constexpr const char *const name = "OnDecrypt"; }; +template<> struct EventName<Event::CreateBot> { static constexpr const char *const name = "OnCreateBot"; }; +template<> struct EventName<Event::DelBot> { static constexpr const char *const name = "OnDelBot"; }; +template<> struct EventName<Event::PrePartChannel> { static constexpr const char *const name = "OnPrePartChannel"; }; +template<> struct EventName<Event::PartChannel> { static constexpr const char *const name = "OnPartChannel"; }; +template<> struct EventName<Event::LeaveChannel> { static constexpr const char *const name = "OnLeaveChannel"; }; +template<> struct EventName<Event::JoinChannel> { static constexpr const char *const name = "OnJoinChannel"; }; +template<> struct EventName<Event::TopicUpdated> { static constexpr const char *const name = "OnTopicUpdated"; }; +template<> struct EventName<Event::PreServerConnect> { static constexpr const char *const name = "OnPreServerConnect"; }; +template<> struct EventName<Event::ServerConnect> { static constexpr const char *const name = "OnServerConnect"; }; +template<> struct EventName<Event::PreUplinkSync> { static constexpr const char *const name = "OnPreUplinkSync"; }; +template<> struct EventName<Event::ServerDisconnect> { static constexpr const char *const name = "OnServerDisconnect"; }; +template<> struct EventName<Event::Restart> { static constexpr const char *const name = "OnRestart"; }; +template<> struct EventName<Event::Shutdown> { static constexpr const char *const name = "OnShutdown"; }; +template<> struct EventName<Event::AddXLine> { static constexpr const char *const name = "OnAddXLine"; }; +template<> struct EventName<Event::DelXLine> { static constexpr const char *const name = "OnDelXLine"; }; +template<> struct EventName<Event::IsServicesOperEvent> { static constexpr const char *const name = "OnIsServicesOper"; }; +template<> struct EventName<Event::ServerQuit> { static constexpr const char *const name = "OnServerQuit"; }; +template<> struct EventName<Event::UserQuit> { static constexpr const char *const name = "OnUserQuit"; }; +template<> struct EventName<Event::PreUserLogoff> { static constexpr const char *const name = "OnPreUserLogoff"; }; +template<> struct EventName<Event::PostUserLogoff> { static constexpr const char *const name = "OnPostUserLogoff"; }; +template<> struct EventName<Event::AccessDel> { static constexpr const char *const name = "OnAccessDel"; }; +template<> struct EventName<Event::AccessAdd> { static constexpr const char *const name = "OnAccessAdd"; }; +template<> struct EventName<Event::AccessClear> { static constexpr const char *const name = "OnAccessClear"; }; +template<> struct EventName<Event::ChanRegistered> { static constexpr const char *const name = "OnChanRegistered"; }; +template<> struct EventName<Event::CreateChan> { static constexpr const char *const name = "OnCreateChan"; }; +template<> struct EventName<Event::DelChan> { static constexpr const char *const name = "OnDelChan"; }; +template<> struct EventName<Event::ChannelCreate> { static constexpr const char *const name = "OnChannelCreate"; }; +template<> struct EventName<Event::ChannelDelete> { static constexpr const char *const name = "OnChannelDelete"; }; +template<> struct EventName<Event::CheckKick> { static constexpr const char *const name = "OnCheckKick"; }; +template<> struct EventName<Event::CheckPriv> { static constexpr const char *const name = "OnCheckPriv"; }; +template<> struct EventName<Event::GroupCheckPriv> { static constexpr const char *const name = "OnGroupCheckPriv"; }; +template<> struct EventName<Event::NickIdentify> { static constexpr const char *const name = "OnNickIdentify"; }; +template<> struct EventName<Event::UserLogin> { static constexpr const char *const name = "OnUserLogin"; }; +template<> struct EventName<Event::NickLogout> { static constexpr const char *const name = "OnNickLogout"; }; +template<> struct EventName<Event::DelNick> { static constexpr const char *const name = "OnDelNick"; }; +template<> struct EventName<Event::NickCoreCreate> { static constexpr const char *const name = "OnNickCoreCreate"; }; +template<> struct EventName<Event::DelCore> { static constexpr const char *const name = "OnDelCore"; }; +template<> struct EventName<Event::ChangeCoreDisplay> { static constexpr const char *const name = "OnChangeCoreDisplay"; }; +template<> struct EventName<Event::NickClearAccess> { static constexpr const char *const name = "OnNickClearAccess"; }; +template<> struct EventName<Event::NickAddAccess> { static constexpr const char *const name = "OnNickAddAccess"; }; +template<> struct EventName<Event::NickEraseAccess> { static constexpr const char *const name = "OnNickEraseAccess"; }; +template<> struct EventName<Event::CheckAuthentication> { static constexpr const char *const name = "OnCheckAuthentication"; }; +template<> struct EventName<Event::Fingerprint> { static constexpr const char *const name = "OnFingerprint"; }; +template<> struct EventName<Event::UserAway> { static constexpr const char *const name = "OnUserAway"; }; +template<> struct EventName<Event::Invite> { static constexpr const char *const name = "OnInvite"; }; +template<> struct EventName<Event::SetVhost> { static constexpr const char *const name = "OnSetVhost"; }; +template<> struct EventName<Event::SetDisplayedHost> { static constexpr const char *const name = "OnSetDisplayedHost"; }; +template<> struct EventName<Event::ChannelModeSet> { static constexpr const char *const name = "OnChannelModeSet"; }; +template<> struct EventName<Event::ChannelModeUnset> { static constexpr const char *const name = "OnChannelModeUnset"; }; +template<> struct EventName<Event::UserModeSet> { static constexpr const char *const name = "OnUserModeSet"; }; +template<> struct EventName<Event::UserModeUnset> { static constexpr const char *const name = "OnUserModeUnset"; }; +template<> struct EventName<Event::ChannelModeAdd> { static constexpr const char *const name = "OnChannelModeAdd"; }; +template<> struct EventName<Event::UserModeAdd> { static constexpr const char *const name = "OnUserModeAdd"; }; +template<> struct EventName<Event::ModuleLoad> { static constexpr const char *const name = "OnModuleLoad"; }; +template<> struct EventName<Event::ModuleUnload> { static constexpr const char *const name = "OnModuleUnload"; }; +template<> struct EventName<Event::ServerSync> { static constexpr const char *const name = "OnServerSync"; }; +template<> struct EventName<Event::UplinkSync> { static constexpr const char *const name = "OnUplinkSync"; }; +template<> struct EventName<Event::BotPrivmsg> { static constexpr const char *const name = "OnBotPrivmsg"; }; +template<> struct EventName<Event::BotNotice> { static constexpr const char *const name = "OnBotNotice"; }; +template<> struct EventName<Event::Privmsg> { static constexpr const char *const name = "OnPrivmsg"; }; +template<> struct EventName<Event::Log> { static constexpr const char *const name = "OnLog"; }; +template<> struct EventName<Event::LogMessage> { static constexpr const char *const name = "OnLogMessage"; }; +template<> struct EventName<Event::CheckModes> { static constexpr const char *const name = "OnCheckModes"; }; +template<> struct EventName<Event::ChannelSync> { static constexpr const char *const name = "OnChannelSync"; }; +template<> struct EventName<Event::SetCorrectModes> { static constexpr const char *const name = "OnSetCorrectModes"; }; +template<> struct EventName<Event::Message> { static constexpr const char *const name = "OnMessage"; }; +template<> struct EventName<Event::CanSet> { static constexpr const char *const name = "OnCanSet"; }; +template<> struct EventName<Event::CheckDelete> { static constexpr const char *const name = "OnCheckDelete"; }; +template<> struct EventName<Event::ExpireTick> { static constexpr const char *const name = "OnExpireTick"; }; +template<> struct EventName<Event::SerializeEvents> { static constexpr const char *const name = "OnSerialize"; }; + diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h index df42af6ec..87986ee62 100644 --- a/include/modules/bs_badwords.h +++ b/include/modules/bs_badwords.h @@ -99,3 +99,4 @@ namespace Event }; } +template<> struct EventName<Event::BadWordEvents> { static constexpr const char *const name = "Badwords"; }; diff --git a/include/modules/bs_bot.h b/include/modules/bs_bot.h index f66d57031..fe6534309 100644 --- a/include/modules/bs_bot.h +++ b/include/modules/bs_bot.h @@ -32,3 +32,7 @@ namespace Event virtual void OnBotDelete(ServiceBot *bi) anope_abstract; }; } + +template<> struct EventName<Event::BotCreate> { static constexpr const char *const name = "OnBotCreate"; }; +template<> struct EventName<Event::BotChange> { static constexpr const char *const name = "OnBotChange"; }; +template<> struct EventName<Event::BotDelete> { static constexpr const char *const name = "OnBotDelete"; }; diff --git a/include/modules/bs_info.h b/include/modules/bs_info.h index 606888f4c..1ebd58c89 100644 --- a/include/modules/bs_info.h +++ b/include/modules/bs_info.h @@ -18,3 +18,4 @@ namespace Event extern CoreExport EventHandlers<ServiceBotEvent> OnServiceBot; } +template<> struct EventName<Event::ServiceBotEvent> { static constexpr const char *const name = "OnServiceBot"; }; diff --git a/include/modules/bs_kick.h b/include/modules/bs_kick.h index 4fe234dd0..1346d7427 100644 --- a/include/modules/bs_kick.h +++ b/include/modules/bs_kick.h @@ -128,3 +128,5 @@ namespace Event }; } +template<> struct EventName<Event::BotBan> { static constexpr const char *const name = "OnBotBan"; }; + diff --git a/include/modules/chanserv.h b/include/modules/chanserv.h index 9985f25dc..a6f741c1b 100644 --- a/include/modules/chanserv.h +++ b/include/modules/chanserv.h @@ -164,7 +164,7 @@ namespace ChanServ */ virtual void OnPreChanExpire(Channel *ci, bool &expire) anope_abstract; }; - static EventHandlersReference<PreChanExpire> OnPreChanExpire("OnPreChanExpire"); + static EventHandlersReference<PreChanExpire> OnPreChanExpire; struct CoreExport ChanExpire : Events { @@ -173,7 +173,7 @@ namespace ChanServ */ virtual void OnChanExpire(Channel *ci) anope_abstract; }; - static EventHandlersReference<ChanExpire> OnChanExpire("OnChanExpire"); + static EventHandlersReference<ChanExpire> OnChanExpire; } /* It matters that Base is here before Extensible (it is inherited by Serializable) @@ -734,3 +734,6 @@ namespace ChanServ } }; } + +template<> struct EventName<ChanServ::Event::PreChanExpire> { static constexpr const char *const name = "OnPreChanExpire"; }; +template<> struct EventName<ChanServ::Event::ChanExpire> { static constexpr const char *const name = "OnChanExpire"; }; diff --git a/include/modules/cs_access.h b/include/modules/cs_access.h index b56996ede..54eb3f353 100644 --- a/include/modules/cs_access.h +++ b/include/modules/cs_access.h @@ -24,3 +24,5 @@ namespace Event virtual void OnLevelChange(CommandSource &source, ChanServ::Channel *ci, const Anope::string &priv, int16_t what) anope_abstract; }; } + +template<> struct EventName<Event::LevelChange> { static constexpr const char *const name = "OnLevelChange"; }; diff --git a/include/modules/cs_akick.h b/include/modules/cs_akick.h index a5c050e51..966dac15b 100644 --- a/include/modules/cs_akick.h +++ b/include/modules/cs_akick.h @@ -60,3 +60,5 @@ namespace Event virtual void OnAkickDel(CommandSource &source, ChanServ::Channel *ci, const AutoKick *ak) anope_abstract; }; } + +template<> struct EventName<Event::Akick> { static constexpr const char *const name = "Akick"; }; diff --git a/include/modules/cs_drop.h b/include/modules/cs_drop.h index 49247b3cb..db231059b 100644 --- a/include/modules/cs_drop.h +++ b/include/modules/cs_drop.h @@ -18,3 +18,5 @@ namespace Event virtual EventReturn OnChanDrop(CommandSource &source, ChanServ::Channel *ci) anope_abstract; }; } + +template<> struct EventName<Event::ChanDrop> { static constexpr const char *const name = "OnChanDrop"; }; diff --git a/include/modules/cs_info.h b/include/modules/cs_info.h index 7b19abd19..f80e3daf2 100644 --- a/include/modules/cs_info.h +++ b/include/modules/cs_info.h @@ -21,3 +21,4 @@ namespace Event }; } +template<> struct EventName<Event::ChanInfo> { static constexpr const char *const name = "OnChanInfo"; }; diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h index a27197533..4d5f9dd2f 100644 --- a/include/modules/cs_mode.h +++ b/include/modules/cs_mode.h @@ -120,3 +120,4 @@ namespace Event }; } +template<> struct EventName<Event::MLockEvents> { static constexpr const char *const name = "MLock"; }; diff --git a/include/modules/cs_set.h b/include/modules/cs_set.h index 355459f7c..a0e81c888 100644 --- a/include/modules/cs_set.h +++ b/include/modules/cs_set.h @@ -20,6 +20,7 @@ namespace Event */ virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChanServ::Channel *ci, const Anope::string &setting) anope_abstract; }; - static EventHandlersReference<SetChannelOption> OnSetChannelOption("OnSetChannelOption"); + static EventHandlersReference<SetChannelOption> OnSetChannelOption; } +template<> struct EventName<Event::SetChannelOption> { static constexpr const char *const name = "OnSetChannelOption"; }; diff --git a/include/modules/cs_suspend.h b/include/modules/cs_suspend.h index 6c561b637..27187ea09 100644 --- a/include/modules/cs_suspend.h +++ b/include/modules/cs_suspend.h @@ -49,3 +49,5 @@ namespace Event extern CoreExport EventHandlers<ChanUnsuspend> OnChanUnsuspend; } +template<> struct EventName<Event::ChanSuspend> { static constexpr const char *const name = "OnChanSuspend"; }; +template<> struct EventName<Event::ChanUnsuspend> { static constexpr const char *const name = "OnChanUnsuspend"; }; diff --git a/include/modules/dns.h b/include/modules/dns.h index 7a0a587fa..f1ee94f87 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -188,9 +188,10 @@ namespace Event */ virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) anope_abstract; }; - static EventHandlersReference<DnsRequest> OnDnsRequest("OnDnsRequest"); + static EventHandlersReference<DnsRequest> OnDnsRequest; } +template<> struct EventName<Event::DnsRequest> { static constexpr const char *const name = "OnDnsRequest"; }; #endif // DNS_H diff --git a/include/modules/fantasy.h b/include/modules/fantasy.h index bb13b959d..1bdd8afdc 100644 --- a/include/modules/fantasy.h +++ b/include/modules/fantasy.h @@ -33,3 +33,6 @@ namespace Event virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChanServ::Channel *ci, const std::vector<Anope::string> ¶ms) anope_abstract; }; } + +template<> struct EventName<Event::BotFantasy> { static constexpr const char *const name = "OnBotFantasy"; }; +template<> struct EventName<Event::BotNoFantasyAccess> { static constexpr const char *const name = "OnBotNoFantasyAccess"; }; diff --git a/include/modules/help.h b/include/modules/help.h index 333e5f9c8..df81aecbf 100644 --- a/include/modules/help.h +++ b/include/modules/help.h @@ -25,3 +25,5 @@ namespace Event virtual void OnPostHelp(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_abstract; }; } + +template<> struct EventName<Event::Help> { static constexpr const char *const name = "Help"; }; diff --git a/include/modules/hs_del.h b/include/modules/hs_del.h index fdec23b21..9b2ea39ef 100644 --- a/include/modules/hs_del.h +++ b/include/modules/hs_del.h @@ -16,3 +16,5 @@ namespace Event virtual void OnDeleteVhost(NickServ::Nick *na) anope_abstract; }; } + +template<> struct EventName<Event::DeleteVhost> { static constexpr const char *const name = "OnDeleteVhost"; }; diff --git a/include/modules/memoserv.h b/include/modules/memoserv.h index 9a209e27f..b7d49ad3a 100644 --- a/include/modules/memoserv.h +++ b/include/modules/memoserv.h @@ -61,7 +61,7 @@ namespace MemoServ */ virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) anope_abstract; }; - static EventHandlersReference<MemoSend> OnMemoSend("OnMemoSend"); + static EventHandlersReference<MemoSend> OnMemoSend; struct CoreExport MemoDel : Events { @@ -72,14 +72,14 @@ namespace MemoServ */ virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) anope_abstract; }; - static EventHandlersReference<MemoDel> OnMemoDel("OnMemoDel"); + static EventHandlersReference<MemoDel> OnMemoDel; } class Memo : public Serialize::Object { protected: using Serialize::Object::Object; -// Memo() : Serialize::Object("Memo") { } + public: virtual MemoInfo *GetMemoInfo() anope_abstract; virtual void SetMemoInfo(MemoInfo *) anope_abstract; @@ -109,8 +109,7 @@ namespace MemoServ { protected: using Serialize::Object::Object; - //using MemoInfo::MemoInfo; - //MemoInfo() : Serialize::Object("MemoInfo") { } + public: virtual Memo *GetMemo(unsigned index) anope_abstract; @@ -148,3 +147,6 @@ namespace MemoServ static Serialize::TypeReference<Ignore> ignore("MemoIgnore"); } + +template<> struct EventName<MemoServ::Event::MemoSend> { static constexpr const char *const name = "OnMemoSend"; }; +template<> struct EventName<MemoServ::Event::MemoDel> { static constexpr const char *const name = "OnMemoDel"; }; diff --git a/include/modules/nickserv.h b/include/modules/nickserv.h index 84ff39520..a6921cf2e 100644 --- a/include/modules/nickserv.h +++ b/include/modules/nickserv.h @@ -67,7 +67,7 @@ namespace NickServ */ virtual void OnPreNickExpire(Nick *na, bool &expire) anope_abstract; }; - static EventHandlersReference<PreNickExpire> OnPreNickExpire("OnPreNickExpire"); + static EventHandlersReference<PreNickExpire> OnPreNickExpire; struct CoreExport NickExpire : Events { @@ -76,7 +76,7 @@ namespace NickServ */ virtual void OnNickExpire(Nick *na) anope_abstract; }; - static EventHandlersReference<NickExpire> OnNickExpire("OnNickExpire"); + static EventHandlersReference<NickExpire> OnNickExpire; struct CoreExport NickRegister : Events { @@ -87,7 +87,7 @@ namespace NickServ */ virtual void OnNickRegister(User *user, Nick *na, const Anope::string &password) anope_abstract; }; - static EventHandlersReference<NickRegister> OnNickRegister("OnNickRegister"); + static EventHandlersReference<NickRegister> OnNickRegister; struct CoreExport NickValidate : Events { @@ -99,7 +99,7 @@ namespace NickServ */ virtual EventReturn OnNickValidate(User *u, Nick *na) anope_abstract; }; - static EventHandlersReference<NickValidate> OnNickValidate("OnNickValidate"); + static EventHandlersReference<NickValidate> OnNickValidate; } /* A registered nickname. @@ -293,3 +293,8 @@ namespace NickServ static Serialize::TypeReference<Mode> mode("NSKeepMode"); } + +template<> struct EventName<NickServ::Event::PreNickExpire> { static constexpr const char *const name = "OnPreNickExpire"; }; +template<> struct EventName<NickServ::Event::NickExpire> { static constexpr const char *const name = "OnNickExpire"; }; +template<> struct EventName<NickServ::Event::NickRegister> { static constexpr const char *const name = "OnNickRegister"; }; +template<> struct EventName<NickServ::Event::NickValidate> { static constexpr const char *const name = "OnNickValidate"; }; diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h index 994f0378e..be75fb9bf 100644 --- a/include/modules/ns_cert.h +++ b/include/modules/ns_cert.h @@ -62,3 +62,5 @@ namespace Event }; } + +template<> struct EventName<Event::NickCertEvents> { static constexpr const char *const name = "OnNickCert"; }; diff --git a/include/modules/ns_drop.h b/include/modules/ns_drop.h index 9217a924c..bae9d77b6 100644 --- a/include/modules/ns_drop.h +++ b/include/modules/ns_drop.h @@ -19,3 +19,4 @@ namespace Event extern CoreExport EventHandlers<NickDrop> OnNickDrop; } +template<> struct EventName<Event::NickDrop> { static constexpr const char *const name = "OnNickDrop"; }; diff --git a/include/modules/ns_group.h b/include/modules/ns_group.h index a254c4412..caa568a9e 100644 --- a/include/modules/ns_group.h +++ b/include/modules/ns_group.h @@ -18,3 +18,5 @@ namespace Event virtual void OnNickGroup(User *u, NickServ::Nick *target) anope_abstract; }; } + +template<> struct EventName<Event::NickGroup> { static constexpr const char *const name = "OnNickGroup"; }; diff --git a/include/modules/ns_info.h b/include/modules/ns_info.h index dd593ce59..e816cc356 100644 --- a/include/modules/ns_info.h +++ b/include/modules/ns_info.h @@ -20,3 +20,5 @@ namespace Event virtual void OnNickInfo(CommandSource &source, NickServ::Nick *na, InfoFormatter &info, bool show_hidden) anope_abstract; }; } + +template<> struct EventName<Event::NickInfo> { static constexpr const char *const name = "OnNickInfo"; }; diff --git a/include/modules/ns_set.h b/include/modules/ns_set.h index b958b4cf5..c6b86032b 100644 --- a/include/modules/ns_set.h +++ b/include/modules/ns_set.h @@ -20,5 +20,7 @@ namespace Event */ virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickServ::Account *nc, const Anope::string &setting) anope_abstract; }; - static EventHandlersReference<SetNickOption> OnSetNickOption("OnSetNickOption"); + static EventHandlersReference<SetNickOption> OnSetNickOption; } + +template<> struct EventName<Event::SetNickOption> { static constexpr const char *const name = "OnSetNickOption"; }; diff --git a/include/modules/ns_suspend.h b/include/modules/ns_suspend.h index b985cb218..fcfc0265d 100644 --- a/include/modules/ns_suspend.h +++ b/include/modules/ns_suspend.h @@ -40,12 +40,14 @@ namespace Event virtual void OnNickSuspend(NickServ::Nick *na) anope_abstract; }; - struct CoreExport NickUnsuspended : Events + struct CoreExport NickUnsuspend : Events { /** Called when a nick is unsuspneded * @param na The nick alias */ - virtual void OnNickUnsuspended(NickServ::Nick *na) anope_abstract; + virtual void OnNickUnsuspend(NickServ::Nick *na) anope_abstract; }; } +template<> struct EventName<Event::NickSuspend> { static constexpr const char *const name = "OnNickSuspend"; }; +template<> struct EventName<Event::NickUnsuspend> { static constexpr const char *const name = "OnNickUnsuspend"; }; diff --git a/include/modules/ns_update.h b/include/modules/ns_update.h index d5d01320a..ce75c33ac 100644 --- a/include/modules/ns_update.h +++ b/include/modules/ns_update.h @@ -18,3 +18,4 @@ namespace Event }; } +template<> struct EventName<Event::NickUpdate> { static constexpr const char *const name = "OnNickUpdate"; }; diff --git a/include/modules/os_defcon.h b/include/modules/os_defcon.h index 81b220eb3..f980d5008 100644 --- a/include/modules/os_defcon.h +++ b/include/modules/os_defcon.h @@ -18,3 +18,4 @@ namespace Event }; } +template<> struct EventName<Event::DefconLevel> { static constexpr const char *const name = "OnDefconLevel"; }; diff --git a/include/modules/os_session.h b/include/modules/os_session.h index c6af4fb03..b9afd196e 100644 --- a/include/modules/os_session.h +++ b/include/modules/os_session.h @@ -74,3 +74,4 @@ namespace Event }; } +template<> struct EventName<Event::Exception> { static constexpr const char *const name = "Exception"; }; |
