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 /modules/commands | |
| 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 'modules/commands')
46 files changed, 123 insertions, 119 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 90f6f80cf..350aa9c00 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -227,8 +227,8 @@ class BSAssign : public Module public: BSAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::Invite>("OnInvite") - , EventHook<Event::ServiceBotEvent>("OnServiceBotEvent") + , EventHook<Event::Invite>() + , EventHook<Event::ServiceBotEvent>() , nobot(this, botinfo, "BS_NOBOT") diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index 744f625e1..22488a1c0 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -455,7 +455,7 @@ class BSBadwords : public Module BSBadwords(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandbsbadwords(this) , badwords(this) - , events(this, "Badwords") + , events(this) , bwtype(this) { bwevents = &events; diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 2e9d5980c..c67c5d168 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -275,7 +275,10 @@ class CommandBSBot : public Command } public: - CommandBSBot(Module *creator) : Command(creator, "botserv/bot", 1, 6), OnBotCreate(creator, "OnBotCreate"), OnBotChange(creator, "OnBotChange"), OnBotDelete(creator, "OnBotDelete") + CommandBSBot(Module *creator) : Command(creator, "botserv/bot", 1, 6) + , OnBotCreate(creator) + , OnBotChange(creator) + , OnBotDelete(creator) { this->SetDesc(_("Maintains network bot list")); this->SetSyntax(_("\002ADD \037nicknae\037 \037username\037 \037hostname\037 \037realname\037\002")); diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 7b100bc41..6d74c308e 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -106,7 +106,8 @@ class BSInfo : public Module public: BSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , commandbsinfo(this, onbotinfo), onbotinfo(this, "OnServiceBot") + , commandbsinfo(this, onbotinfo) + , onbotinfo(this) { } diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index b29a5dc31..e7b4738cd 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -1279,8 +1279,8 @@ class BSKick : public Module public: BSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::ServiceBotEvent>("OnServiceBotEvent") - , EventHook<Event::Privmsg>("OnPrivmsg") + , EventHook<Event::ServiceBotEvent>() + , EventHook<Event::Privmsg>() , bandata(this, "bandata") , userdata(this, "userdata") @@ -1303,7 +1303,7 @@ class BSKick : public Module , purger(this) - , onbotban(this, "OnBotBan") + , onbotban(this) { me = this; } diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 8a95edcaf..58015ba01 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -194,7 +194,7 @@ class BSSet : public Module public: BSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::BotBan>("OnBotBan") + , EventHook<Event::BotBan>() , commandbsset(this) , commandbssetbanexpire(this) , commandbssetprivate(this) diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index e1431e977..7e9c47993 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -891,10 +891,10 @@ class CSAccess : public Module public: CSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::GroupCheckPriv>("OnGroupCheckPriv") + , EventHook<Event::GroupCheckPriv>() , commandcsaccess(this) , commandcslevels(this, onlevelchange) - , onlevelchange(this, "OnLevelChange") + , onlevelchange(this) , accesschanaccesstype(this) { this->SetPermanent(true); diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 4174c9b20..f88904a46 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -668,9 +668,9 @@ class CSAKick : public Module public: CSAKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::CheckKick>("OnCheckKick") + , EventHook<Event::CheckKick>() , commandcsakick(this, akickevents) - , akickevents(this, "Akick") + , akickevents(this) , akick_type(this) { } diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 6ac3df61c..a1020bcab 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -92,7 +92,7 @@ class CSDrop : public Module public: CSDrop(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandcsdrop(this, onchandrop) - , onchandrop(this, "OnChanDrop") + , onchandrop(this) { } diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 6695a7cec..51654ea84 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -254,7 +254,7 @@ class CSEntryMessage : public Module public: CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::JoinChannel>("OnJoinChannel") + , EventHook<Event::JoinChannel>() , commandentrymsg(this) , entrymsg_type(this) { diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 7f08e7e91..43405a18d 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -88,7 +88,7 @@ class CSInfo : public Module public: CSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandcsinfo(this, eventonchaninfo) - , eventonchaninfo(this, "OnChanInfo") + , eventonchaninfo(this) { } diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index 9e7e6a31b..44c96d0ce 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -244,7 +244,7 @@ class CSList : public Module public: CSList(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::ChanInfo>("OnChanInfo") + , EventHook<Event::ChanInfo>() , commandcslist(this) , commandcssetprivate(this) , priv(this, "CS_PRIVATE") diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 695493b78..6c7ca03d1 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -345,8 +345,8 @@ class CSLog : public Module public: CSLog(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::ChanRegistered>("OnChanRegistered") - , EventHook<Event::Log>("OnLog") + , EventHook<Event::ChanRegistered>() + , EventHook<Event::Log>() , commandcslog(this) , logtype(this) { diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index f66c5ce87..d26e113d6 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -861,14 +861,14 @@ class CSMode : public Module public: CSMode(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::CheckModes>("OnCheckModes") - , EventHook<Event::ChanRegistered>("OnChanRegistered") - , EventHook<Event::ChanInfo>("OnChanInfo") + , EventHook<Event::CheckModes>() + , EventHook<Event::ChanRegistered>() + , EventHook<Event::ChanInfo>() , commandcsmode(this) , commandcsmodes(this) , modelock(this) , modelock_type(this) - , modelockevents(this, "MLock") + , modelockevents(this) { events = &modelockevents; } diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index c730609be..0474b8e26 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -378,13 +378,13 @@ class CSSeen : public Module public: CSSeen(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::ExpireTick>("OnExpireTick") - , EventHook<Event::UserConnect>("OnUserConnect") - , EventHook<Event::UserNickChange>("OnUserNickChange") - , EventHook<Event::UserQuit>("OnUserQuit") - , EventHook<Event::JoinChannel>("OnJoinChannel") - , EventHook<Event::PartChannel>("OnPartChannel") - , EventHook<Event::PreUserKicked>("OnPreUserKicked") + , EventHook<Event::ExpireTick>() + , EventHook<Event::UserConnect>() + , EventHook<Event::UserNickChange>() + , EventHook<Event::UserQuit>() + , EventHook<Event::JoinChannel>() + , EventHook<Event::PartChannel>() + , EventHook<Event::PreUserKicked>() // , seeninfo_type("SeenInfo", SeenInfo::Unserialize) , commandseen(this) , commandosseen(this) diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 2a811b5b2..9cf58c029 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1101,18 +1101,18 @@ class CSSet : public Module public: CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::CreateChan>("OnCreateChan") - , EventHook<Event::ChannelCreate>("OnChannelCreate") - , EventHook<Event::ChannelSync>("OnChannelSync") - , EventHook<Event::CheckKick>("OnCheckKick") - , EventHook<Event::DelChan>("OnDelChan") - , EventHook<Event::ChannelModeSet>("OnChannelModeSet") - , EventHook<Event::ChannelModeUnset>("OnChannelModeUnset") - , EventHook<Event::CheckDelete>("OnCheckDelete") - , EventHook<Event::JoinChannel>("OnJoinChannel") - , EventHook<Event::SetCorrectModes>("OnSetCorrectModes") - , EventHook<ChanServ::Event::PreChanExpire>("OnPreChanExpire") - , EventHook<Event::ChanInfo>("OnChanInfo") + , EventHook<Event::CreateChan>() + , EventHook<Event::ChannelCreate>() + , EventHook<Event::ChannelSync>() + , EventHook<Event::CheckKick>() + , EventHook<Event::DelChan>() + , EventHook<Event::ChannelModeSet>() + , EventHook<Event::ChannelModeUnset>() + , EventHook<Event::CheckDelete>() + , EventHook<Event::JoinChannel>() + , EventHook<Event::SetCorrectModes>() + , EventHook<ChanServ::Event::PreChanExpire>() + , EventHook<Event::ChanInfo>() , noautoop(this, ChanServ::channel, "NOAUTOOP") , peace(this, ChanServ::channel, "PEACE") diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 35b943f6c..48716b194 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -175,7 +175,7 @@ class CSSetMisc : public Module public: CSSetMisc(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::ChanInfo>("OnChanInfo") + , EventHook<Event::ChanInfo>() , commandcssetmisc(this) , type(this) { diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index dadb7c15d..6fd234014 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -268,14 +268,14 @@ class CSSuspend : public Module public: CSSuspend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::ChanInfo>("OnChanInfo") - , EventHook<ChanServ::Event::PreChanExpire>("OnPreChanExpire") - , EventHook<Event::CheckKick>("OnCheckKick") - , EventHook<Event::ChanDrop>("OnChanDrop") + , EventHook<Event::ChanInfo>() + , EventHook<ChanServ::Event::PreChanExpire>() + , EventHook<Event::CheckKick>() + , EventHook<Event::ChanDrop>() , commandcssuspend(this, onchansuspend) , commandcsunsuspend(this, onchanunsuspend) - , onchansuspend(this, "OnChanSuspend") - , onchanunsuspend(this, "OnChanUnsuspend") + , onchansuspend(this) + , onchanunsuspend(this) , cst(this) { } diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 213876749..5fd40bdf0 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -211,9 +211,9 @@ class CSTopic : public Module public: 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") + , EventHook<Event::ChannelSync>() + , EventHook<Event::TopicUpdated>() + , EventHook<Event::ChanInfo>() , commandcstopic(this) , commandcssetkeeptopic(this) , topiclock(this, "TOPICLOCK") diff --git a/modules/commands/greet.cpp b/modules/commands/greet.cpp index a66b28e11..9134876cc 100644 --- a/modules/commands/greet.cpp +++ b/modules/commands/greet.cpp @@ -170,9 +170,9 @@ class Greet : public Module public: Greet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::JoinChannel>("OnJoinChannel") - , EventHook<Event::NickInfo>("OnNickInfo") - , EventHook<Event::ServiceBotEvent>("OnServiceBotEvent") + , EventHook<Event::JoinChannel>() + , EventHook<Event::NickInfo>() + , EventHook<Event::ServiceBotEvent>() , bs_greet(this, ChanServ::channel, "BS_GREET") , ns_greet(this, NickServ::account, "greet") , commandbssetgreet(this) diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp index 419474574..debb25837 100644 --- a/modules/commands/help.cpp +++ b/modules/commands/help.cpp @@ -188,7 +188,7 @@ class Help : public Module public: Help(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandhelp(this, onhelp) - , onhelp(this, "Help") + , onhelp(this) { } diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index 8c9c20c1c..4d7e7aac9 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -99,7 +99,7 @@ class HSDel : public Module HSDel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandhsdel(this, ondeletevhost) , commandhsdelall(this, ondeletevhost) - , ondeletevhost(this, "OnDeleteVhost") + , ondeletevhost(this) { } diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp index dc66d4477..5635b8ce6 100644 --- a/modules/commands/hs_group.cpp +++ b/modules/commands/hs_group.cpp @@ -84,8 +84,8 @@ class HSGroup : public Module public: HSGroup(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::SetVhost>("OnSetVhost") - , EventHook<Event::NickGroup>("OnNickGroup") + , EventHook<Event::SetVhost>() + , EventHook<Event::NickGroup>() , commandhsgroup(this) { } diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp index d944c8736..7b727452a 100644 --- a/modules/commands/ns_access.cpp +++ b/modules/commands/ns_access.cpp @@ -236,7 +236,7 @@ class NSAccess : public Module public: NSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<NickServ::Event::NickRegister>("OnNickRegister") + , EventHook<NickServ::Event::NickRegister>() , commandnsaccess(this) , nick_type(this) { diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 93fb136b9..7aca41b3e 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -282,7 +282,7 @@ class NSAJoin : public Module public: NSAJoin(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::UserLogin>("OnUserLogin") + , EventHook<Event::UserLogin>() , commandnsajoin(this) , ajtype(this) { diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index c743c619a..a241f9c97 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -313,11 +313,11 @@ class NSCert : public Module public: NSCert(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::Fingerprint>("OnFingerprint") - , EventHook<NickServ::Event::NickValidate>("OnNickValidate") + , EventHook<Event::Fingerprint>() + , EventHook<NickServ::Event::NickValidate>() , commandnscert(this) , cs(this) - , onnickservevents(this, "OnNickCert") + , onnickservevents(this) { if (!IRCD || !IRCD->CanCertFP) throw ModuleException("Your IRCd does not support ssl client certificates"); diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index f778cac00..62ee41970 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -82,7 +82,7 @@ class NSDrop : public Module public: NSDrop(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandnsdrop(this, onnickdrop) - , onnickdrop(this, "OnNickDrop") + , onnickdrop(this) { } diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 0af17d29a..e3acf74f9 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -375,7 +375,7 @@ class NSGroup : public Module , commandnsgroup(this, onnickgroup) , commandnsungroup(this) , commandnsglist(this) - , onnickgroup(this, "OnNickGroup") + , onnickgroup(this) { if (Config->GetModule("nickserv")->Get<bool>("nonicknameownership")) throw ModuleException(modname + " can not be used with options:nonicknameownership enabled"); diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index 63adea013..7091e53fd 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -268,7 +268,7 @@ class NSInfo : public Module , commandnsinfo(this, onnickinfo) , commandnssethide(this) , commandnssasethide(this) - , onnickinfo(this, "OnNickInfo") + , onnickinfo(this) , hide_email(this, NickServ::account, "HIDE_EMAIL") , hide_usermask(this, NickServ::account, "HIDE_MASK") , hide_status(this, NickServ::account, "HIDE_STATUS") diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index b382625d8..e5dd56562 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -270,7 +270,7 @@ class NSList : public Module public: NSList(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::NickInfo>("OnNickInfo") + , EventHook<Event::NickInfo>() , commandnslist(this) , commandnssetprivate(this) , commandnssasetprivate(this) diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index f3caf416b..21d11124f 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -202,8 +202,8 @@ class NSRecover : public Module public: NSRecover(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::UserNickChange>("OnUserNickChange") - , EventHook<Event::JoinChannel>("OnJoinChannel") + , EventHook<Event::UserNickChange>() + , EventHook<Event::JoinChannel>() , commandnsrecover(this) , recover(this, "recover") { diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 4e7890d79..1c601e2a2 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -350,8 +350,8 @@ class NSRegister : public Module public: NSRegister(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::NickIdentify>("OnNickIdentify") - , EventHook<NickServ::Event::PreNickExpire>("OnPreNickExpire") + , EventHook<Event::NickIdentify>() + , EventHook<NickServ::Event::PreNickExpire>() , commandnsregister(this) , commandnsconfirm(this) , commandnsrsend(this) diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index a1c32976c..2ee7f7a01 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -67,7 +67,7 @@ class NSResetPass : public Module public: NSResetPass(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , EventHook<Event::PreCommand>("OnPreCommand") + , EventHook<Event::PreCommand>() , commandnsresetpass(this), reset(this, "reset") { if (!Config->GetBlock("mail")->Get<bool>("usemail")) diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index d78edb150..f60c23053 100644 --- a/modules/commands/ns_set.cpp +++ b/ |
