diff options
author | Adam <Adam@anope.org> | 2013-05-27 19:36:37 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-27 19:36:37 -0400 |
commit | 37b3535543b81c3d75c8f62b83d422f0d2fbced0 (patch) | |
tree | 8a062415c91d352e4b6bd180cbf238d1f159802d /modules | |
parent | c21e8d9204f9b671177a63d4daa21957bffc1d9f (diff) |
Initially attach all modules to all events, and detach them as the events are run if they are not implemented per module
Diffstat (limited to 'modules')
99 files changed, 121 insertions, 295 deletions
diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index ae60f5b5a..41aecd8af 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -14,8 +14,6 @@ class BSAutoAssign : public Module public: BSAutoAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) { - Implementation i[] = { I_OnChanRegistered }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnChanRegistered(ChannelInfo *ci) anope_override diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 9a0b638c7..7b241f09e 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -154,8 +154,6 @@ class BSAssign : public Module BSAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandbsassign(this), commandbsunassign(this) { - Implementation i[] = { I_OnInvite }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnInvite(User *source, Channel *c, User *targ) anope_override diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index aa3cf378d..020044aef 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -81,7 +81,7 @@ class CommandBSBot : public Command source.Reply(_("%s!%s@%s (%s) added to the bot list."), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); - FOREACH_MOD(I_OnBotCreate, OnBotCreate(bi)); + FOREACH_MOD(OnBotCreate, (bi)); return; } @@ -220,7 +220,7 @@ class CommandBSBot : public Command source.Reply(_("Bot \002%s\002 has been changed to %s!%s@%s (%s)."), oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); Log(LOG_ADMIN, source, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname; - FOREACH_MOD(I_OnBotChange, OnBotChange(bi)); + FOREACH_MOD(OnBotChange, (bi)); return; } @@ -247,7 +247,7 @@ class CommandBSBot : public Command return; } - FOREACH_MOD(I_OnBotDelete, OnBotDelete(bi)); + FOREACH_MOD(OnBotDelete, (bi)); Log(LOG_ADMIN, source, this) << "DEL " << bi->nick; diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 4b869421d..50d4a0e5f 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -771,7 +771,7 @@ class BSKick : public Module Anope::string mask = ci->GetIdealBan(u); ci->c->SetMode(NULL, "BAN", mask); - FOREACH_MOD(I_OnBotBan, OnBotBan(u, ci, mask)); + FOREACH_MOD(OnBotBan, (u, ci, mask)); } } @@ -802,8 +802,6 @@ class BSKick : public Module { me = this; - Implementation i[] = { I_OnPrivmsg }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~BSKick() diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 95500ac94..fa2bd716f 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -495,7 +495,6 @@ class BSSet : public Module commandbsset(this), commandbssetbanexpire(this), commandbssetdontkickops(this), commandbssetdontkickvoices(this), commandbssetfantasy(this), commandbssetgreet(this), commandbssetnobot(this), commandbssetprivate(this) { - ModuleManager::Attach(I_OnBotBan, this); } void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) anope_override diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 64b2386fb..8562efeb4 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -175,7 +175,7 @@ class CommandCSAccess : public Command access->created = Anope::CurTime; ci->AddAccess(access); - FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, source, access)); + FOREACH_MOD(OnAccessAdd, (ci, source, access)); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to add " << mask << " with level " << level; source.Reply(_("\002%s\002 added to %s access list at level \002%d\002."), access->mask.c_str(), ci->name.c_str(), level); @@ -258,7 +258,7 @@ class CommandCSAccess : public Command else Nicks = access->mask; - FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, access)); + FOREACH_MOD(OnAccessDel, (ci, source, access)); ci->EraseAccess(Number - 1); } @@ -284,7 +284,7 @@ class CommandCSAccess : public Command bool override = !u_access.founder && !u_access.HasPriv("ACCESS_CHANGE") && !access->mask.equals_ci(source.nc->display); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << access->mask; - FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, access)); + FOREACH_MOD(OnAccessDel, (ci, source, access)); delete access; } return; @@ -429,7 +429,7 @@ class CommandCSAccess : public Command source.Reply(ACCESS_DENIED); else { - FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, source)); + FOREACH_MOD(OnAccessClear, (ci, source)); ci->ClearAccess(); @@ -597,7 +597,7 @@ class CommandCSLevels : public Command else { ci->SetLevel(p->name, level); - FOREACH_MOD(I_OnLevelChange, OnLevelChange(source, ci, p->name, level)); + FOREACH_MOD(OnLevelChange, (source, ci, p->name, level)); bool override = !source.AccessFor(ci).HasPriv("FOUNDER"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to set " << p->name << " to level " << level; @@ -621,7 +621,7 @@ class CommandCSLevels : public Command if (p != NULL) { ci->SetLevel(p->name, ACCESS_INVALID); - FOREACH_MOD(I_OnLevelChange, OnLevelChange(source, ci, p->name, ACCESS_INVALID)); + FOREACH_MOD(OnLevelChange, (source, ci, p->name, ACCESS_INVALID)); bool override = !source.AccessFor(ci).HasPriv("FOUNDER"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable " << p->name; @@ -673,7 +673,7 @@ class CommandCSLevels : public Command void DoReset(CommandSource &source, ChannelInfo *ci) { reset_levels(ci); - FOREACH_MOD(I_OnLevelChange, OnLevelChange(source, ci, "ALL", 0)); + FOREACH_MOD(OnLevelChange, (source, ci, "ALL", 0)); bool override = !source.AccessFor(ci).HasPriv("FOUNDER"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to reset all levels"; @@ -791,8 +791,6 @@ class CSAccess : public Module { this->SetPermanent(true); - Implementation i[] = { I_OnReload, I_OnCreateChan, I_OnGroupCheckPriv }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 1cce6afbe..b54fca191 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -160,7 +160,7 @@ class CommandCSAKick : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to add " << mask << (reason == "" ? "" : ": ") << reason; - FOREACH_MOD(I_OnAkickAdd, OnAkickAdd(source, ci, akick)); + FOREACH_MOD(OnAkickAdd, (source, ci, akick)); source.Reply(_("\002%s\002 added to %s autokick list."), mask.c_str(), ci->name.c_str()); @@ -210,7 +210,7 @@ class CommandCSAKick : public Command if (!number || number > ci->GetAkickCount()) return; - FOREACH_MOD(I_OnAkickDel, OnAkickDel(source, ci, ci->GetAkick(number - 1))); + FOREACH_MOD(OnAkickDel, (source, ci, ci->GetAkick(number - 1))); ++deleted; ci->EraseAkick(number - 1); @@ -241,7 +241,7 @@ class CommandCSAKick : public Command bool override = !source.AccessFor(ci).HasPriv("AKICK"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << mask; - FOREACH_MOD(I_OnAkickDel, OnAkickDel(source, ci, ci->GetAkick(i))); + FOREACH_MOD(OnAkickDel, (source, ci, ci->GetAkick(i))); ci->EraseAkick(i); @@ -512,8 +512,6 @@ class CSAKick : public Module CSAKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandcsakick(this) { - Implementation i[] = { I_OnCheckKick }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) anope_override diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index d7045123f..d9ba97894 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -85,7 +85,7 @@ public: else target_ci->last_topic_setter = source.service->nick; - FOREACH_MOD(I_OnChanRegistered, OnChanRegistered(target_ci)); + FOREACH_MOD(OnChanRegistered, (target_ci)); source.Reply(_("All settings from \002%s\002 have been cloned to \002%s\002."), channel.c_str(), target.c_str()); } diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 998dd8ab0..3f14aea65 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -52,7 +52,7 @@ class CommandCSDrop : public Command bool override = (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "(founder was: " << (ci->GetFounder() ? ci->GetFounder()->display : "none") << ")"; - FOREACH_MOD(I_OnChanDrop, OnChanDrop(ci)); + FOREACH_MOD(OnChanDrop, (ci)); Reference<Channel> c = ci->c; delete ci; diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index c5e31f122..f94aca44c 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -272,8 +272,6 @@ class CSEntryMessage : public Module CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), entrymsg_type("EntryMsg", EntryMsg::Unserialize), commandentrymsg(this) { - Implementation i[] = { I_OnJoinChannel }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnJoinChannel(User *u, Channel *c) anope_override diff --git a/modules/commands/cs_fantasy_stats.cpp b/modules/commands/cs_fantasy_stats.cpp index a7324bf9f..d54ed4a92 100644 --- a/modules/commands/cs_fantasy_stats.cpp +++ b/modules/commands/cs_fantasy_stats.cpp @@ -71,8 +71,6 @@ class CSStats : public Module { me = this; - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/cs_fantasy_top.cpp b/modules/commands/cs_fantasy_top.cpp index ca2e67ab9..bc08c4c9d 100644 --- a/modules/commands/cs_fantasy_top.cpp +++ b/modules/commands/cs_fantasy_top.cpp @@ -96,8 +96,6 @@ class CSTop : public Module { me = this; - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 4867b9029..23e6914d3 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -178,7 +178,7 @@ class CommandCSFlags : public Command { if (current != NULL) { - FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, current)); + FOREACH_MOD(OnAccessDel, (ci, source, current)); delete current; Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << mask; source.Reply(_("\002%s\002 removed from the %s access list."), mask.c_str(), ci->name.c_str()); @@ -206,7 +206,7 @@ class CommandCSFlags : public Command ci->AddAccess(access); - FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, source, access)); + FOREACH_MOD(OnAccessAdd, (ci, source, access)); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to modify " << mask << "'s flags to " << access->AccessSerialize(); source.Reply(_("Access for \002%s\002 on %s set to +\002%s\002"), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str()); @@ -285,7 +285,7 @@ class CommandCSFlags : public Command { ci->ClearAccess(); - FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, source)); + FOREACH_MOD(OnAccessClear, (ci, source)); source.Reply(_("Channel %s access list has been cleared."), ci->name.c_str()); @@ -391,8 +391,6 @@ class CSFlags : public Module { this->SetPermanent(true); - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, 1); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 3f9a014bb..0d3623c00 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -105,7 +105,7 @@ class CommandCSInfo : public Command info["Expires on"] = Anope::strftime(ci->last_used + chanserv_expire); } - FOREACH_MOD(I_OnChanInfo, OnChanInfo(source, ci, info, show_all)); + FOREACH_MOD(OnChanInfo, (source, ci, info, show_all)); std::vector<Anope::string> replies; info.Process(replies); diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index a7987a740..969ebe5ab 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -186,8 +186,6 @@ class CSLog : public Module MSService("MemoServService", "MemoServ"), commandcslog(this) { - Implementation i[] = { I_OnLog }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnLog(Log *l) anope_override diff --git a/modules/commands/cs_register.cpp b/modules/commands/cs_register.cpp index 4d4bc9353..135f833be 100644 --- a/modules/commands/cs_register.cpp +++ b/modules/commands/cs_register.cpp @@ -75,7 +75,7 @@ class CommandCSRegister : public Command c->SetCorrectModes(u, true); } - FOREACH_MOD(I_OnChanRegistered, OnChanRegistered(ci)); + FOREACH_MOD(OnChanRegistered, (ci)); } } diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp index aacd3c168..877fc31b7 100644 --- a/modules/commands/cs_seen.cpp +++ b/modules/commands/cs_seen.cpp @@ -296,15 +296,6 @@ class CSSeen : public Module public: CSSeen(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), seeninfo_type("SeenInfo", SeenInfo::Unserialize), commandseen(this), commandosseen(this) { - - Implementation eventlist[] = { I_OnExpireTick, - I_OnUserConnect, - I_OnUserNickChange, - I_OnUserQuit, - I_OnJoinChannel, - I_OnPartChannel, - I_OnPreUserKicked }; - ModuleManager::Attach(eventlist, this, sizeof(eventlist) / sizeof(Implementation)); } void OnExpireTick() anope_override diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 45373e254..1211c5ed0 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -73,7 +73,7 @@ class CommandCSSetAutoOp : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -130,7 +130,7 @@ class CommandCSSetBanType : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -191,7 +191,7 @@ class CommandCSSetChanstats : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -245,7 +245,7 @@ class CommandCSSetDescription : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -300,7 +300,7 @@ class CommandCSSetFounder : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -363,7 +363,7 @@ class CommandCSSetKeepTopic : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -420,7 +420,7 @@ class CommandCSSetPeace : public Command return; } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -479,7 +479,7 @@ class CommandCSSetPersist : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -627,7 +627,7 @@ class CommandCSSetPrivate : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -689,7 +689,7 @@ class CommandCSSetRestricted : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -745,7 +745,7 @@ class CommandCSSetSecure : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -803,7 +803,7 @@ class CommandCSSetSecureFounder : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -861,7 +861,7 @@ class CommandCSSetSecureOps : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -917,7 +917,7 @@ class CommandCSSetSignKick : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -988,7 +988,7 @@ class CommandCSSetSuccessor : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -1128,10 +1128,6 @@ class CSSet : public Module commandcssetsecure(this), commandcssetsecurefounder(this), commandcssetsecureops(this), commandcssetsignkick(this), commandcssetsuccessor(this), commandcssetnoexpire(this) { - - Implementation i[] = { I_OnCheckKick, I_OnDelChan, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnCheckDelete, I_OnJoinChannel, - I_OnSetCorrectModes }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) anope_override diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 5f1359f18..21ebec815 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -85,7 +85,7 @@ class CommandCSSetMisc : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); if (MOD_RESULT == EVENT_STOP) return; @@ -136,8 +136,6 @@ class CSSetMisc : public Module CSSetMisc(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), csmiscdata_type("CSMiscData", CSMiscData::Unserialize), commandcssetmisc(this) { - Implementation i[] = { I_OnReload, I_OnChanInfo }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index 88a369e58..98015a1f3 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -74,7 +74,7 @@ class CommandCSSuspend : public Command Log(LOG_ADMIN, source, this, ci) << (!reason.empty() ? reason : "No reason") << ", expires in " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never"); source.Reply(_("Channel \002%s\002 is now suspended."), ci->name.c_str()); - FOREACH_MOD(I_OnChanSuspend, OnChanSuspend(ci)); + FOREACH_MOD(OnChanSuspend, (ci)); return; } @@ -136,7 +136,7 @@ class CommandCSUnSuspend : public Command source.Reply(_("Channel \002%s\002 is now released."), ci->name.c_str()); - FOREACH_MOD(I_OnChanUnsuspend, OnChanUnsuspend(ci)); + FOREACH_MOD(OnChanUnsuspend, (ci)); return; } @@ -161,8 +161,6 @@ class CSSuspend : public Module commandcssuspend(this), commandcsunsuspend(this) { - Implementation i[] = { I_OnChanInfo, I_OnPreChanExpire, I_OnCheckKick }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) anope_override diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 64e710017..294689864 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -16,7 +16,7 @@ class CommandCSTopic : public Command void Lock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, "topiclock on")); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, "topiclock on")); if (MOD_RESULT == EVENT_STOP) return; @@ -27,7 +27,7 @@ class CommandCSTopic : public Command void Unlock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, "topiclock off")); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, "topiclock off")); if (MOD_RESULT == EVENT_STOP) return; diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 192eb4529..253dde884 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -182,7 +182,7 @@ class CommandCSXOP : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to add " << mask; - FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, source, acc)); + FOREACH_MOD(OnAccessAdd, (ci, source, acc)); source.Reply(_("\002%s\002 added to %s %s list."), acc->mask.c_str(), ci->name.c_str(), source.command.c_str()); } @@ -287,7 +287,7 @@ class CommandCSXOP : public Command else nicks = caccess->mask; - FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, caccess)); + FOREACH_MOD(OnAccessDel, (ci, source, caccess)); ci->EraseAccess(number - 1); } @@ -307,7 +307,7 @@ class CommandCSXOP : public Command source.Reply(_("\002%s\002 deleted from %s %s list."), a->mask.c_str(), ci->name.c_str(), source.command.c_str()); - FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, a)); + FOREACH_MOD(OnAccessDel, (ci, source, a)); delete a; return; @@ -431,7 +431,7 @@ class CommandCSXOP : public Command ci->EraseAccess(i - 1); } - FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, source)); + FOREACH_MOD(OnAccessClear, (ci, source)); source.Reply(_("Channel %s %s list has been cleared."), ci->name.c_str(), source.command.c_str()); } @@ -554,8 +554,6 @@ class CSXOP : public Module { this->SetPermanent(true); - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/help.cpp b/modules/commands/help.cpp index 47ce98825..ac8c98b09 100644 --- a/modules/commands/help.cpp +++ b/modules/commands/help.cpp @@ -37,7 +37,7 @@ class CommandHelp : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnPreHelp, OnPreHelp(source, params)); + FOREACH_RESULT(OnPreHelp, MOD_RESULT, (source, params)); if (MOD_RESULT == EVENT_STOP) return; @@ -184,7 +184,7 @@ class CommandHelp : public Command source.Reply(_("No help available for \002%s\002."), params[0].c_str()); } - FOREACH_MOD(I_OnPostHelp, OnPostHelp(source, params)); + FOREACH_MOD(OnPostHelp, (source, params)); return; } diff --git a/modules/commands/hs_del.cpp b/modules/commands/hs_del.cpp index 1fa4f7b31..cf1a0d84a 100644 --- a/modules/commands/hs_del.cpp +++ b/modules/commands/hs_del.cpp @@ -27,7 +27,7 @@ class CommandHSDel : public Command if (na) { Log(LOG_ADMIN, source, this) << "for user " << na->nick; - FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na)); + FOREACH_MOD(OnDeleteVhost, (na)); na->RemoveVhost(); source.Reply(_("Vhost for \002%s\002 removed."), nick.c_str()); } @@ -60,7 +60,7 @@ class CommandHSDelAll : public Command NickAlias *na = NickAlias::Find(nick); if (na) { - FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na)); + FOREACH_MOD(OnDeleteVhost, (na)); const NickCore *nc = na->nc; for (unsigned i = 0; i < nc->aliases->size(); ++i) { diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index d12973e01..6cd2b314f 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -190,7 +190,7 @@ class CommandHSActivate : public Command if (req) { na->SetVhost(req->ident, req->host, source.GetNick(), req->time); - FOREACH_MOD(I_OnSetVhost, OnSetVhost(na)); + FOREACH_MOD(OnSetVhost, (na)); if (Config->GetModule(this->owner)->Get<bool>("memouser") && memoserv) memoserv->Send(source.service->nick, na->nick, _("[auto memo] Your requested vHost has been approved."), true); diff --git a/modules/commands/hs_set.cpp b/modules/commands/hs_set.cpp index 834ac5fc1..5e7f9f2af 100644 --- a/modules/commands/hs_set.cpp +++ b/modules/commands/hs_set.cpp @@ -80,7 +80,7 @@ class CommandHSSet : public Command Log(LOG_ADMIN, source, this) << "to set the vhost of " << na->nick << " to " << (!user.empty() ? user + "@" : "") << host; na->SetVhost(user, host, source.GetNick()); - FOREACH_MOD(I_OnSetVhost, OnSetVhost(na)); + FOREACH_MOD(OnSetVhost, (na)); if (!user.empty()) source.Reply(_("VHost for \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), user.c_str(), host.c_str()); else @@ -182,7 +182,7 @@ class CommandHSSetAll : public Command na->SetVhost(user, host, source.GetNick()); this->Sync(na); - FOREACH_MOD(I_OnSetVhost, OnSetVhost(na)); + FOREACH_MOD(OnSetVhost, (na)); if (!user.empty()) source.Reply(_("VHost for group \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), user.c_str(), host.c_str()); else diff --git a/modules/commands/ms_cancel.cpp b/modules/commands/ms_cancel.cpp index cf1a0809f..18ddcfa09 100644 --- a/modules/commands/ms_cancel.cpp +++ b/modules/commands/ms_cancel.cpp @@ -41,9 +41,9 @@ class CommandMSCancel : public Command if (mi->GetMemo(i)->unread && source.nc->display.equals_ci(mi->GetMemo(i)->sender)) { if (ischan) - FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(i))); + FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(i))); else - FOREACH_MOD(I_OnMemoDel, OnMemoDel(na->nc, mi, mi->GetMemo(i))); + FOREACH_MOD(OnMemoDel, (na->nc, mi, mi->GetMemo(i))); mi->Del(i); source.Reply(_("Last memo to \002%s\002 has been cancelled."), nname.c_str()); return; diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index dac5ae43e..c789e697b 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -27,9 +27,9 @@ class MemoDelCallback : public NumberList return; if (ci) - FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(number - 1))); + FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(number - 1))); else - FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(number - 1))); + FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(number - 1))); mi->Del(number - 1); source.Reply(_("Memo %d has been deleted."), number); @@ -97,9 +97,9 @@ class CommandMSDel : public Command { /* Delete last memo. */ if (ci) - FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(mi->memos->size() - 1))); + FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(mi->memos->size() - 1))); else - FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(mi->memos->size() - 1))); + FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(mi->memos->size() - 1))); mi->Del(mi->memos->size() - 1); source.Reply(_("Memo %d has been deleted."), mi->memos->size() + 1); } @@ -109,9 +109,9 @@ class CommandMSDel : public Command for (unsigned i = 0, end = mi->memos->size(); i < end; ++i) { if (ci) - FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(i))); + FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(i))); else - FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(i))); + FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(i))); delete mi->GetMemo(i); } mi->memos->clear(); diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp index 4fa3a2074..d42ef5bc6 100644 --- a/modules/commands/ns_access.cpp +++ b/modules/commands/ns_access.cpp @@ -180,8 +180,6 @@ class NSAccess : public Module NSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandnsaccess(this) { - Implementation i[] = { I_OnNickRegister }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnNickRegister(User *u, NickAlias *na) anope_override diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 0de8b43ff..836e0cf6d 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -242,8 +242,6 @@ class NSAJoin : public Module if (!IRCD->CanSVSJoin) throw ModuleException("Your IRCd does not support SVSJOIN"); - Implementation i[] = { I_OnNickIdentify }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnNickIdentify(User *u) anope_override diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index 022d803ea..dc877e467 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -225,8 +225,6 @@ class NSCert : public Module if (!IRCD || !IRCD->CanCertFP) throw ModuleException("Your IRCd does not support ssl client certificates"); - Implementation i[] = { I_OnFingerprint }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } diff --git a/modules/commands/ns_drop.cpp b/modules/commands/ns_drop.cpp index a21cac709..1cb83994e 100644 --- a/modules/commands/ns_drop.cpp +++ b/modules/commands/ns_drop.cpp @@ -45,7 +45,7 @@ class CommandNSDrop : public Command source.Reply(_("You may not drop other Services Operators' nicknames.")); else { - FOREACH_MOD(I_OnNickDrop, OnNickDrop(source, na)); + FOREACH_MOD(OnNickDrop, (source, na)); Log(!is_mine ? LOG_ADMIN : LOG_COMMAND, source, this) << "to drop nickname " << na->nick << " (group: " << na->nc->display << ") (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")"; delete na; diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 9b202b31c..989fc1385 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -31,7 +31,7 @@ class NSGroupRequest : public IdentifyRequest /* If the nick is already registered, drop it. */ if (na) { - FOREACH_MOD(I_OnChangeCoreDisplay, OnChangeCoreDisplay(na->nc, u->nick)); + FOREACH_MOD(OnChangeCoreDisplay, (na->nc, u->nick)); delete na; } @@ -44,7 +44,7 @@ class NSGroupRequest : public IdentifyRequest u->Login(target->nc); IRCD->SendLogin(u); - FOREACH_MOD(I_OnNickGroup, OnNickGroup(u, target)); + FOREACH_MOD(OnNickGroup, (u, target)); Log(LOG_COMMAND, source, cmd) << "makes " << nick << " join group of " << target->nick << " (" << target->nc->display << ") (email: " << (!target->nc->email.empty() ? target->nc->email : "none") << ")"; source.Reply(_("You are now in the group of \002%s\002."), target->nick.c_str()); @@ -147,7 +147,7 @@ class CommandNSGroup : public Command if (ok == false && !pass.empty()) { NSGroupRequest *req = new NSGroupRequest(owner, source, this, u->nick, target, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(source.GetUser(), req)); + FOREACH_MOD(OnCheckAuthentication, (source.GetUser(), req)); req->Dispatch(); } else diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp index aec43c1be..d66913851 100644 --- a/modules/commands/ns_identify.cpp +++ b/modules/commands/ns_identify.cpp @@ -82,7 +82,7 @@ class CommandNSIdentify : public Command else { NSIdentifyRequest *req = new NSIdentifyRequest(owner, source, this, na ? na->nc->display : nick, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(u, req)); + FOREACH_MOD(OnCheckAuthentication, (u, req)); req->Dispatch(); } return; diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index f1de95275..864136cd8 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -135,7 +135,7 @@ class CommandNSInfo : public Command } } - FOREACH_MOD(I_OnNickInfo, OnNickInfo(source, na, info, show_hidden)); + FOREACH_MOD(OnNickInfo, (source, na, info, show_hidden)); std::vector<Anope::string> replies; info.Process(replies); diff --git a/modules/commands/ns_logout.cpp b/modules/commands/ns_logout.cpp index d5765b0f6..28559d314 100644 --- a/modules/commands/ns_logout.cpp +++ b/modules/commands/ns_logout.cpp @@ -54,7 +54,7 @@ class CommandNSLogout : public Command u2->Logout(); /* Send out an event */ - FOREACH_MOD(I_OnNickLogout, OnNickLogout(u2)); + FOREACH_MOD(OnNickLogout, (u2)); } return; } diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index 33bc9d19e..224b4e2ed 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -169,7 +169,7 @@ class CommandNSRecover : public Command if (ok == false && !pass.empty()) { NSRecoverRequest *req = new NSRecoverRequest(owner, source, this, na->nick, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(source.GetUser(), req)); + FOREACH_MOD(OnCheckAuthentication, (source.GetUser(), req)); req->Dispatch(); } else @@ -209,8 +209,6 @@ class NSRecover : public Module if (Config->GetBlock("options")->Get<bool>("nonicknameownership")) throw ModuleException(modname + " can not be used with options:nonicknameownership enabled"); - Implementation i[] = { I_OnUserNickChange, I_OnJoinChannel, I_OnShutdown, I_OnRestart }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~NSRecover() diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index ac1c55696..4064ce924 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -194,7 +194,7 @@ class CommandNSRegister : public Command Log(LOG_COMMAND, source, this) << "to register " << na->nick << " (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")"; - FOREACH_MOD(I_OnNickRegister, OnNickRegister(source.GetUser(), na)); + FOREACH_MOD(OnNickRegister, (source.GetUser(), na)); if (na->nc->GetAccessCount()) source.Reply(_("Nickname \002%s\002 registered under your user@host-mask: %s"), u_nick.c_str(), na->nc->GetAccess(0).c_str()); diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index 44d941662..9b15e53ac 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -71,7 +71,6 @@ class NSResetPass : public Module throw ModuleException("Not using mail."); - ModuleManager::Attach(I_OnPreCommand, this); } ~NSResetPass() diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index fd32fb2be..4b2dfe684 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -224,7 +224,7 @@ class CommandNSSetAutoOp : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -306,7 +306,7 @@ class CommandNSSetChanstats : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, na->nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, na->nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -395,7 +395,7 @@ class CommandNSSetDisplay : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, user_na->nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, user_na->nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -510,7 +510,7 @@ class CommandNSSetEmail : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -599,7 +599,7 @@ class CommandNSSetGreet : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -682,7 +682,7 @@ class CommandNSSetHide : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -811,7 +811,7 @@ class CommandNSSetKill : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -937,7 +937,7 @@ class CommandNSSetLanguage : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -1045,7 +1045,7 @@ class CommandNSSetMessage : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -1134,7 +1134,7 @@ class CommandNSSetPrivate : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -1223,7 +1223,7 @@ class CommandNSSetSecure : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -1399,8 +1399,6 @@ class NSSet : public Module commandnssasetnoexpire(this) { - Implementation i[] = { I_OnPreCommand, I_OnSetCorrectModes }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp index 753450414..15fb0ed33 100644 --- a/modules/commands/ns_set_misc.cpp +++ b/modules/commands/ns_set_misc.cpp @@ -87,7 +87,7 @@ class CommandNSSetMisc : public Command NickCore *nc = na->nc; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param)); + FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -155,8 +155,6 @@ class NSSetMisc : public Module NSSetMisc(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), nsmiscdata_type("NSMiscData", NSMiscData::Unserialize), commandnssetmisc(this), commandnssasetmisc(this) { - Implementation i[] = { I_OnReload, I_OnNickInfo }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index eadb35d7d..0db7cd951 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -94,7 +94,7 @@ class CommandNSSuspend : public Command Log(LOG_ADMIN, source, this) << "for " << nick << " (" << (!reason.empty() ? reason : "No reason") << "), expires in " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never"); source.Reply(_("Nick %s is now suspended."), nick.c_str()); - FOREACH_MOD(I_OnNickSuspended, OnNickSuspend(na)); + FOREACH_MOD(OnNickSuspend, (na)); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override @@ -150,7 +150,7 @@ class CommandNSUnSuspend : public Command Log(LOG_ADMIN, source, this) << "for " << na->nick; source.Reply(_("Nick %s is now released."), nick.c_str()); - FOREACH_MOD(I_OnNickUnsuspended, OnNickUnsuspended(na)); + FOREACH_MOD(OnNickUnsuspended, (na)); return; } @@ -173,8 +173,6 @@ class NSSuspend : public Module NSSuspend(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandnssuspend(this), commandnsunsuspend(this) { - Implementation i[] = { I_OnPreNickExpire, I_OnNickInfo }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override diff --git a/modules/commands/ns_update.cpp b/modules/commands/ns_update.cpp index b56f8eded..2676c886f 100644 --- a/modules/commands/ns_update.cpp +++ b/modules/commands/ns_update.cpp @@ -31,7 +31,7 @@ class CommandNSUpdate : public Command na->last_seen = Anope::CurTime; } - FOREACH_MOD(I_OnNickUpdate, OnNickUpdate(u)); + FOREACH_MOD(OnNickUpdate, (u)); source.Reply(_("Status updated (memos, vhost, chmodes, flags).")); } diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index 34e6dbd2b..ef783c8af 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -180,7 +180,7 @@ class CommandOSAKill : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddXLine, OnAddXLine(source, x, akills)); + FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, akills)); if (MOD_RESULT == EVENT_STOP) { delete x; @@ -231,7 +231,7 @@ class CommandOSAKill : public Command do { - FOREACH_MOD(I_OnDelXLine, OnDelXLine(source, x, akills)); + FOREACH_MOD(OnDelXLine, (source, x, akills)); source.Reply(_("\002%s\002 deleted from the AKILL list."), x->mask.c_str()); AkillDelCallback::DoDel(source, x); @@ -353,7 +353,7 @@ class CommandOSAKill : public Command for (unsigned i = akills->GetCount(); i > 0; --i) { XLine *x = akills->GetEntry(i - 1); - FOREACH_MOD(I_OnDelXLine, OnDelXLine(source, x, akills)); + FOREACH_MOD(OnDelXLine, (source, x, akills)); akills->DelXLine(x); } diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index ba695649d..8bea10d0f 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -125,7 +125,7 @@ class DefConTimeout : public Timer if (DConfig.defaultlevel != level) { DConfig.defaultlevel = level; - FOREACH_MOD(I_OnDefconLevel, OnDefconLevel(level)); + FOREACH_MOD(OnDefconLevel, (level)); Log(Config->GetClient("OperServ"), "operserv/defcon") << "Defcon level timeout, returning to level " << level; if (DConfig.globalondefcon) @@ -203,7 +203,7 @@ class CommandOSDefcon : public Command DConfig.defaultlevel = newLevel; - FOREACH_MOD(I_OnDefconLevel, OnDefconLevel(newLevel)); + FOREACH_MOD(OnDefconLevel, (newLevel)); delete timeout; @@ -333,8 +333,6 @@ class OSDefcon : public Module OSDefcon(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), session_service("SessionService", "session"), akills("XLineManager", "xlinemanager/sgline"), commandosdefcon(this) { - Implementation i[] = { I_OnReload, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnPreCommand, I_OnUserConnect, I_OnChannelModeAdd, I_OnChannelSync }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index 32e6be59d..c71b1f887 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -656,8 +656,6 @@ class ModuleDNS : public Module zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this) { - Implementation i[] = { I_OnReload, I_OnNewServer, I_OnServerQuit, I_OnUserConnect, I_OnPreUserLogoff, I_OnDnsRequest }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); for (unsigned j = 0; j < dns_servers->size(); ++j) { diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index a56d08219..bd837919c 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -251,8 +251,6 @@ class OSForbid : public Module forbiddata_type("ForbidData", ForbidData::Unserialize), forbidService(this), commandosforbid(this) { - Implementation i[] = { I_OnUserConnect, I_OnUserNickChange, I_OnJoinChannel, I_OnPreCommand }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnUserConnect(User *u, bool &exempt) anope_override diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index 56c784856..60c1bd8bf 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -320,8 +320,6 @@ class OSIgnore : public Module ignoredata_type("IgnoreData", IgnoreData::Unserialize), osignoreservice(this), commandosignore(this) { - Implementation i[] = { I_OnBotPrivmsg }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 573379236..9d666188a 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -116,7 +116,6 @@ class OSLogin : public Module commandoslogin(this), commandoslogout(this) { - ModuleManager::Attach(I_IsServicesOper, this); } ~OSLogin() diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index 1d55df843..cb6a9fcfa 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -385,8 +385,6 @@ class OSNews : public Module OSNews(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), newsitem_type("NewsItem", NewsItem::Unserialize), newsservice(this), commandoslogonnews(this), commandosopernews(this), commandosrandomnews(this) { - Implementation i[] = { I_OnUserModeSet, I_OnUserConnect }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnUserModeSet(User *u, const Anope::string &mname) anope_override diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index 239b09a32..171b11c94 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -82,7 +82,6 @@ class OSNOOP : public Module commandosnoop(this) { - ModuleManager::Attach(I_OnUserModeSet, this); } void OnUserModeSet(User *u, const Anope::string &mname) anope_override diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index af6a547f5..9496090db 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -156,7 +156,7 @@ class ExceptionDelCallback : public NumberList static void DoDel(CommandSource &source, unsigned index) { Exception *e = session_service->GetExceptions()[index]; - FOREACH_MOD(I_OnExceptionDel, OnExceptionDel(source, e)); + FOREACH_MOD(OnExceptionDel, (source, e)); session_service->DelException(e); delete e; @@ -360,7 +360,7 @@ class CommandOSException : public Command exception->expires = expires; EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnExceptionAdd, OnExceptionAdd(exception)); + FOREACH_RESULT(OnExceptionAdd, MOD_RESULT, (exception)); if (MOD_RESULT == EVENT_STOP) delete exception; else @@ -619,8 +619,6 @@ class OSSession : public Module { this->SetPermanent(true); - Implementation i[] = { I_OnReload, I_OnUserConnect, I_OnUserQuit, I_OnExpireTick }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); ModuleManager::SetPriority(this, PRIORITY_FIRST); } diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index d12237c93..7cd3c12ca 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -91,7 +91,7 @@ class CommandOSSXLineBase : public Command return; } - FOREACH_MOD(I_OnDelXLine, OnDelXLine(source, x, this->xlm())); + FOREACH_MOD(OnDelXLine, (source, x, this->xlm())); SXLineDelCallback::DoDel(this->xlm(), source, x); source.Reply(_("\002%s\002 deleted from the %s list."), mask.c_str(), source.command.c_str()); @@ -198,7 +198,7 @@ class CommandOSSXLineBase : public Command void OnClear(CommandSource &source) { - FOREACH_MOD(I_OnDelXLine, OnDelXLine(source, NULL, this->xlm())); + FOREACH_MOD(OnDelXLine, (source, NULL, this->xlm())); for (unsigned i = this->xlm()->GetCount(); i > 0; --i) { @@ -370,7 +370,7 @@ class CommandOSSNLine : public CommandOSSXLineBase } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddXLine, OnAddXLine(source, x, this->xlm())); + FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm())); if (MOD_RESULT == EVENT_STOP) { delete x; @@ -576,7 +576,7 @@ class CommandOSSQLine : public CommandOSSXLineBase } EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnAddXLine, OnAddXLine(source, x, this->xlm())); + FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm())); if (MOD_RESULT == EVENT_STOP) { delete x; diff --git a/modules/cs_statusupdate.cpp b/modules/cs_statusupdate.cpp index bdb6c73d0..b4294fbd6 100644 --- a/modules/cs_statusupdate.cpp +++ b/modules/cs_statusupdate.cpp @@ -13,8 +13,6 @@ class StatusUpdate : public Module StatusUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) { - Implementation i[] = { I_OnAccessAdd, I_OnAccessDel }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnAccessAdd(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 27b6ce1a2..e7ea2f262 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -164,8 +164,6 @@ class DBFlatFile : public Module, public Pipe DBFlatFile(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR), last_day(0), loaded(false) { - Implementation i[] = { I_OnLoadDatabase, I_OnSaveDatabase, I_OnSerializeTypeCreate }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnNotify() anope_override diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index b901d879a..053a49110 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -1093,8 +1093,6 @@ class DBOld : public Module DBOld(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR) { - Implementation i[] = { I_OnLoadDatabase, I_OnUplinkSync }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); hashm = Config->GetModule(this)->Get<const Anope::string>("hash"); diff --git a/modules/database/db_plain.cpp b/modules/database/db_plain.cpp index a2c8d4274..1e4586a11 100644 --- a/modules/database/db_plain.cpp +++ b/modules/database/db_plain.cpp @@ -380,7 +380,7 @@ static void ReadDatabase(Module *m = NULL) /*if (m) MOD_RESULT = m->OnDatabaseRead(params); else - FOREACH_RESULT(I_OnDatabaseRead, OnDatabaseRead(params)); + FOREACH_RESULT(OnDatabaseRead, MOD_RESULT, (params)); if (MOD_RESULT == EVENT_STOP) continue;*/ OnDatabaseRead(params); @@ -587,8 +587,6 @@ class DBPlain : public Module public: DBPlain(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR) { - Implementation i[] = { I_OnReload, I_OnLoadDatabase, I_OnSaveDatabase }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); LastDay = 0; } @@ -645,9 +643,6 @@ class DBPlain : public Module { ReadDatabase(); - /* No need to ever reload this again, although this should never be trigged again */ - ModuleManager::Detach(I_OnLoadDatabase, this); - return EVENT_STOP; } @@ -702,7 +697,7 @@ class DBPlain : public Module } for (unsigned k = 0, end = mi->ignores.size(); k < end; ++k) db_buffer << "MD MIG " << Anope::string(mi->ignores[k]) << endl; - //FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, nc)); + //FOREACH_MOD(OnDatabaseWriteMetadata, (WriteMetadata, nc)); } for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it) @@ -727,7 +722,7 @@ class DBPlain : public Module if (na->HasVhost()) db_buffer << "MD VHOST " << na->GetVhostCreator() << " " << na->GetVhostCreated() << " " << na->GetVhostHost() << " :" << na->GetVhostIdent() << endl; - //FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, na)); + //FOREACH_MOD(OnDatabaseWriteMetadata, (WriteMetadata, na)); } for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) @@ -836,7 +831,7 @@ class DBPlain : public Module db_buffer << "MD BI BADWORD " << (ci->GetBadWord(k)->type == BW_ANY ? "ANY " : "") << (ci->GetBadWord(k)->type == BW_SINGLE ? "SINGLE " : "") << (ci->GetBadWord(k)->type == BW_START ? "START " : "") << (ci->GetBadWord(k)->type == BW_END ? "END " : "") << ":" << ci->GetBadWord(k)->word << endl; - //FOREACH_MOD(I_OnDatabaseWriteMetadata, OnDatabaseWriteMetadata(WriteMetadata, ci)); + //FOREACH_MOD(OnDatabaseWriteMetadata, (WriteMetadata, ci)); } db_buffer << "OS STATS " << MaxUserCount << " " << MaxUserTime << endl; @@ -858,7 +853,7 @@ class DBPlain : public Module db_buffer << "OS EXCEPTION " << e->mask << " " << e->limit << " " << e->who << " " << e->time << " " << e->expires << " " << e->reason << endl; } - //FOREACH_MOD(I_OnDatabaseWrite, OnDatabaseWrite(Write)); + //FOREACH_MOD(OnDatabaseWrite, (Write)); std::fstream db; db.open(DatabaseFile.c_str(), std::ios_base::out | std::ios_base::trunc); diff --git a/modules/database/db_redis.cpp b/modules/database/db_redis.cpp index 122248f95..e78134857 100644 --- a/modules/database/db_redis.cpp +++ b/modules/database/db_redis.cpp @@ -132,8 +132,6 @@ class DatabaseRedis : public Module, public Pipe { me = this; - Implementation i[] = { I_OnReload, I_OnLoadDatabase, I_OnSerializeTypeCreate, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } /* Insert or update an object */ diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index bb4d5277b..b575d3fd1 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -92,8 +92,6 @@ class DBSQL : public Module, public Pipe DBSQL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR), sql("", ""), sqlinterface(this), shutting_down(false), loading_databases(false), loaded(false), imported(false) { - Implementation i[] = { I_OnReload, I_OnShutdown, I_OnRestart, I_OnLoadDatabase, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate, I_OnSerializeTypeCreate }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); if (ModuleManager::FindModule("db_sql_live") != NULL) throw ModuleException("db_sql can not be loaded after db_sql_live"); diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index 992a15471..02e8a355f 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -70,8 +70,6 @@ class DBMySQL : public Module, public Pipe this->ro = false; this->init = false; - Implementation i[] = { I_OnReload, I_OnShutdown, I_OnLoadDatabase, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializeCheck, I_OnSerializableUpdate }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); if (ModuleManager::FindFirstOf(DATABASE) != this) throw ModuleException("If db_sql_live is loaded it must be the first database module loaded."); diff --git a/modules/encryption/enc_md5.cpp b/modules/encryption/enc_md5.cpp index e19931800..a352e8dec 100644 --- a/modules/encryption/enc_md5.cpp +++ b/modules/encryption/enc_md5.cpp @@ -346,8 +346,6 @@ class EMD5 : public Module md5provider(this) { - Implementation i[] = { I_OnEncrypt, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override diff --git a/modules/encryption/enc_none.cpp b/modules/encryption/enc_none.cpp index 5f219000c..9754c0c4f 100644 --- a/modules/encryption/enc_none.cpp +++ b/modules/encryption/enc_none.cpp @@ -15,8 +15,6 @@ class ENone : public Module ENone(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR) { - Implementation i[] = { I_OnEncrypt, I_OnDecrypt, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override diff --git a/modules/encryption/enc_old.cpp b/modules/encryption/enc_old.cpp index 037a2fffc..eee9b25b6 100644 --- a/modules/encryption/enc_old.cpp +++ b/modules/encryption/enc_old.cpp @@ -49,8 +49,6 @@ class EOld : public Module if (!md5) throw ModuleException("Unable to find md5 reference"); - Implementation i[] = { I_OnEncrypt, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override diff --git a/modules/encryption/enc_sha1.cpp b/modules/encryption/enc_sha1.cpp index c1f032874..4ef3e51fe 100644 --- a/modules/encryption/enc_sha1.cpp +++ b/modules/encryption/enc_sha1.cpp @@ -201,8 +201,6 @@ class ESHA1 : public Module sha1provider(this) { - Implementation i[] = { I_OnEncrypt, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest) anope_override diff --git a/modules/encryption/enc_sha256.cpp b/modules/encryption/enc_sha256.cpp index 85fbaf223..099b778dd 100644 --- a/modules/encryption/enc_sha256.cpp +++ b/modules/encryption/enc_sha256.cpp @@ -277,8 +277,6 @@ class ESHA256 : public Module sha256provider(this) { - Implementation i[] = { I_OnEncrypt, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); use_iv = false; } diff --git a/modules/extra/m_chanstats.cpp b/modules/extra/m_chanstats.cpp index 3d3430752..9a3c5dfaf 100644 --- a/modules/extra/m_chanstats.cpp +++ b/modules/extra/m_chanstats.cpp @@ -336,17 +336,6 @@ class MChanstats : public Module MChanstats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), sql("", ""), sqlinterface(this) { - - Implementation i[] = { I_OnPrivmsg, - I_OnPreUserKicked, - I_OnChannelModeSet, - I_OnChannelModeUnset, - I_OnTopicUpdated, - I_OnDelCore, - I_OnChangeCoreDisplay, - I_OnChanDrop, - I_OnReload}; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/extra/m_httpd.cpp b/modules/extra/m_httpd.cpp index 212abfa4f..6524a87b5 100644 --- a/modules/extra/m_httpd.cpp +++ b/modules/extra/m_httpd.cpp @@ -334,8 +334,6 @@ class HTTPD : public Module HTTPD(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), sslref("SSLService", "ssl") { - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~HTTPD() diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 17ad60213..61410d274 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -407,8 +407,6 @@ class ModuleLDAP : public Module, public Pipe { me = this; - Implementation i[] = { I_OnReload, I_OnModuleUnload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~ModuleLDAP() diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 617929380..d64987ed6 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -103,7 +103,7 @@ class IdentifyInterface : public LDAPInterface if (na == NULL) { na = new NickAlias(ii->req->GetAccount(), new NickCore(ii->req->GetAccount())); - FOREACH_MOD(I_OnNickRegister, OnNickRegister(ii->user, na)); + FOREACH_MOD(OnNickRegister, (ii->user, na)); BotInfo *NickServ = Config->GetClient("NickServ"); if (ii->user && NickServ) ii->user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); @@ -217,8 +217,6 @@ class NSIdentifyLDAP : public Module me = this; - Implementation i[] = { I_OnReload, I_OnPreCommand, I_OnCheckAuthentication, I_OnNickIdentify, I_OnNickRegister }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); ModuleManager::SetPriority(this, PRIORITY_FIRST); } diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index 43ee81408..3e16d75e6 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -89,8 +89,6 @@ class LDAPOper : public Module Module(modname, creator, EXTRA | VENDOR), ldap("LDAPProvider", "ldap/main"), iinterface(this) { - Implementation i[] = { I_OnReload, I_OnNickIdentify, I_OnDelCore }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 8cf12ca79..c42d82ee6 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -169,8 +169,6 @@ class ModuleSQL : public Module, public Pipe { me = this; - Implementation i[] = { I_OnReload, I_OnModuleUnload }; - ModuleManager::Attach(i, this, 2); DThread = new DispatcherThread(); DThread->Start(); diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp index fb5f96758..7f8adb60e 100644 --- a/modules/extra/m_proxyscan.cpp +++ b/modules/extra/m_proxyscan.cpp @@ -221,8 +221,6 @@ class ModuleProxyScan : public Module connectionTimeout(this, 5) { - Implementation i[] = { I_OnReload, I_OnUserConnect }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); this->listener = NULL; } diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 648dc22c2..bbd4e8b23 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -42,7 +42,7 @@ class SQLAuthenticationResult : public SQL::Interface if (na == NULL) { na = new NickAlias(req->GetAccount(), new NickCore(req->GetAccount())); - FOREACH_MOD(I_OnNickRegister, OnNickRegister(user, na)); + FOREACH_MOD(OnNickRegister, (user, na)); if (user && NickServ) user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); } @@ -78,8 +78,6 @@ class ModuleSQLAuthentication : public Module { me = this; - Implementation i[] = { I_OnReload, I_OnPreCommand, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp index 6f9f05004..772d484c6 100644 --- a/modules/extra/m_sql_oper.cpp +++ b/modules/extra/m_sql_oper.cpp @@ -98,8 +98,6 @@ class ModuleSQLOper : public Module ModuleSQLOper(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR) { - Implementation i[] = { I_OnReload, I_OnNickIdentify }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index bea4d8d95..b306ccfcf 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -66,8 +66,6 @@ class ModuleSQLite : public Module public: ModuleSQLite(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR) { - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~ModuleSQLite() diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp index 19b0aaf8f..10d1b5807 100644 --- a/modules/extra/m_ssl.cpp +++ b/modules/extra/m_ssl.cpp @@ -117,8 +117,6 @@ class SSLModule : public Module SSL_CTX_set_session_id_context(client_ctx, reinterpret_cast<const unsigned char *>(context_name.c_str()), context_name.length()); SSL_CTX_set_session_id_context(server_ctx, reinterpret_cast<const unsigned char *>(context_name.c_str()), context_name.length()); - ModuleManager::Attach(I_OnReload, this); - ModuleManager::Attach(I_OnPreServerConnect, this); } ~SSLModule() diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp index 66e2db9ac..3c16f997e 100644 --- a/modules/extra/m_xmlrpc.cpp +++ b/modules/extra/m_xmlrpc.cpp @@ -168,8 +168,6 @@ class ModuleXMLRPC : public Module throw ModuleException("Unable to find http reference, is m_httpd loaded?"); httpref->RegisterPage(&xmlrpcinterface); - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~ModuleXMLRPC() diff --git a/modules/extra/m_xmlrpc_main.cpp b/modules/extra/m_xmlrpc_main.cpp index b697a2c8c..c1db97603 100644 --- a/modules/extra/m_xmlrpc_main.cpp +++ b/modules/extra/m_xmlrpc_main.cpp @@ -117,7 +117,7 @@ class MyXMLRPCEvent : public XMLRPCEvent else { XMLRPCIdentifyRequest *req = new XMLRPCIdentifyRequest(me, request, client, iface, username, password); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); + FOREACH_MOD(OnCheckAuthentication, (NULL, req)); req->Dispatch(); return false; } diff --git a/modules/extra/webcpanel/pages/index.cpp b/modules/extra/webcpanel/pages/index.cpp index 4449f5f60..51b908b13 100644 --- a/modules/extra/webcpanel/pages/index.cpp +++ b/modules/extra/webcpanel/pages/index.cpp @@ -87,7 +87,7 @@ bool WebCPanel::Index::OnRequest(HTTPProvider *server, const Anope::string &page // Rate limit check. WebpanelRequest *req = new WebpanelRequest(me, reply, message, server, page_name, client, replacements, user, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); + FOREACH_MOD(OnCheckAuthentication, (NULL, req)); req->Dispatch(); return false; } diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index ea64da92f..422d035b3 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -779,7 +779,7 @@ class MyManager : public Manager, public Timer } } - FOREACH_MOD(I_OnDnsRequest, OnDnsRequest(recv_packet, packet)); + FOREACH_MOD(OnDnsRequest, (recv_packet, packet)); for (unsigned i = 0; i < recv_packet.questions.size(); ++i) { @@ -940,8 +940,6 @@ class ModuleDNS : public Module ModuleDNS(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), manager(this) { - Implementation i[] = { I_OnReload, I_OnModuleUnload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index 4a3b7dddc..8a238889f 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -92,8 +92,6 @@ class ModuleDNSBL : public Module ModuleDNSBL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) { - Implementation i[] = { I_OnReload, I_OnUserConnect }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/m_helpchan.cpp b/modules/m_helpchan.cpp index a3003e59f..7739fbcd5 100644 --- a/modules/m_helpchan.cpp +++ b/modules/m_helpchan.cpp @@ -12,8 +12,6 @@ class HelpChannel : public Module public: HelpChannel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) { - Implementation i[] = { I_OnChannelModeSet }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string ¶m) anope_override diff --git a/modules/m_redis.cpp b/modules/m_redis.cpp index 03f6f8547..2237f8709 100644 --- a/modules/m_redis.cpp +++ b/modules/m_redis.cpp @@ -529,8 +529,6 @@ class ModuleRedis : public Module public: ModuleRedis(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR) { - Implementation i[] = { I_OnReload, I_OnModuleUnload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~ModuleRedis() diff --git a/modules/m_rewrite.cpp b/modules/m_rewrite.cpp index f2f3c8690..8eec06d6e 100644 --- a/modules/m_rewrite.cpp +++ b/modules/m_rewrite.cpp @@ -155,8 +155,6 @@ class ModuleRewrite : public Module public: ModuleRewrite(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), cmdrewrite(this) { - Implementation i[] = { I_OnReload }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index ecea98329..d65c24d65 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -554,7 +554,6 @@ class ProtoBahamut : public Module this->AddModes(); - ModuleManager::Attach(I_OnUserNickChange, this); } void OnUserNickChange(User *u, const Anope::string &) anope_override diff --git a/modules/protocol/charybdis.cpp b/modules/protocol/charybdis.cpp index 368c79eac..9b87f3230 100644 --- a/modules/protocol/charybdis.cpp +++ b/modules/protocol/charybdis.cpp @@ -171,7 +171,7 @@ struct IRCDMessageEncap : IRCDMessage if (params[1] == "CERTFP") { u->fingerprint = params[2]; - FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); + FOREACH_MOD(OnFingerprint, (u)); } /* * Received: :42X ENCAP * SASL 42XAAAAAH * S PLAIN @@ -257,7 +257,7 @@ struct IRCDMessageEncap : IRCDMessage return; IdentifyRequest *req = new CharybdisSASLIdentifyRequest(this->owner, source, params[2], acc, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); + FOREACH_MOD(OnCheckAuthentication, (NULL, req)); req->Dispatch(); } } @@ -419,8 +419,6 @@ class ProtoCharybdis : public Module { - Implementation i[] = { I_OnReload, I_OnChannelSync, I_OnMLock, I_OnUnMLock }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); if (ModuleManager::LoadModule("ratbox", User::Find(creator)) != MOD_ERR_OK) throw ModuleException("Unable to load ratbox"); diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 4649f3cf6..ecdaff456 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -610,7 +610,6 @@ public: { this->AddModes(); - ModuleManager::Attach(I_OnUserNickChange, this); if (Me->GetSID() == Me->GetName()) Me->SetSID(Servers::TS6_SID_Retrieve()); diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index f4a29bc50..cc1c5eb4c 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -953,7 +953,7 @@ struct IRCDMessageMetadata : IRCDMessage if ((pos2 - pos1) >= 32) // inspircd supports md5 and sha1 fingerprint hashes -> size 32 or 40 bytes. { u->fingerprint = data.substr(pos1, pos2 - pos1); - FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); + FOREACH_MOD(OnFingerprint, (u)); } } } @@ -1213,8 +1213,6 @@ class ProtoInspIRCd : public Module message_setident(this), message_server(this), message_time(this), message_uid(this) { - Implementation i[] = { I_OnUserNickChange }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); Servers::Capab.insert("NOQUIT"); diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 2d7b4ef29..673836d93 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -699,7 +699,7 @@ struct IRCDMessageEncap : IRCDMessage return; IdentifyRequest *req = new InspIRCDSASLIdentifyRequest(this->owner, params[2], acc, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); + FOREACH_MOD(OnCheckAuthentication, (NULL, req)); req->Dispatch(); } } @@ -790,8 +790,6 @@ class ProtoInspIRCd : public Module throw ModuleException("No protocol interface for insp12"); ModuleManager::DetachAll(m_insp12); - Implementation i[] = { I_OnReload, I_OnUserNickChange, I_OnChannelSync, I_OnChanRegistered, I_OnDelChan, I_OnMLock, I_OnUnMLock, I_OnSetChannelOption }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } ~ProtoInspIRCd() diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index 139c7e5c4..a8ddeed30 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -656,8 +656,6 @@ class ProtongIRCd : public Module this->AddModes(); - Implementation i[] = { I_OnUserNickChange }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnUserNickChange(User *u, const Anope::string &) anope_override diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 9f7e094a2..e3efdc6e6 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -202,7 +202,7 @@ struct IRCDMessageEncap : IRCDMessage if (u) { u->fingerprint = params[3]; - FOREACH_MOD(I_OnFingerprint, OnFingerprint(u)); + FOREACH_MOD(OnFingerprint, (u)); } } return; diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index 6cf07342e..fa6dc15ed 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -920,7 +920,7 @@ struct IRCDMessageSASL : IRCDMessage return; IdentifyRequest *req = new UnrealSASLIdentifyRequest(this->owner, params[1], acc, pass); - FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req)); + FOREACH_MOD(OnCheckAuthentication, (NULL, req)); req->Dispatch(); } } @@ -1211,8 +1211,6 @@ class ProtoUnreal : public Module this->AddModes(); - Implementation i[] = { I_OnReload, I_OnUserNickChange, I_OnChannelSync, I_OnChanRegistered, I_OnDelChan, I_OnMLock, I_OnUnMLock }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); ModuleManager::SetPriority(this, PRIORITY_FIRST); } diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index 828f3b0e2..8322ad3c3 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -18,9 +18,6 @@ class BotServCore : public Module public: BotServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR) { - Implementation i[] = { I_OnReload, I_OnSetCorrectModes, I_OnBotAssign, I_OnPrivmsg, I_OnJoinChannel, I_OnLeaveChannel, - I_OnPreHelp, I_OnPostHelp, I_OnChannelModeSet, I_OnCreateChan, I_OnUserKicked, I_OnCreateBot }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override @@ -148,11 +145,11 @@ class BotServCore : public Module EventReturn MOD_RESULT; if (c->ci->AccessFor(u).HasPriv("FANTASIA")) { - FOREACH_RESULT(I_OnBotFantasy, OnBotFantasy(source, cmd, c->ci, params)); + FOREACH_RESULT(OnBotFantasy, MOD_RESULT, (source, cmd, c->ci, params)); } else { - FOREACH_RESULT(I_OnBotNoFantasyAccess, OnBotNoFantasyAccess(source, cmd, c->ci, params)); + FOREACH_RESULT(OnBotNoFantasyAccess, MOD_RESULT, (source, cmd, c->ci, params)); } if (MOD_RESULT == EVENT_STOP || !c->ci->AccessFor(u).HasPriv("FANTASIA")) @@ -161,7 +158,7 @@ class BotServCore : public Module if (MOD_RESULT != EVENT_ALLOW && !info.permission.empty() && !source.HasCommand(info.permission)) return; - FOREACH_RESULT(I_OnPreCommand, OnPreCommand(source, cmd, params)); + FOREACH_RESULT(OnPreCommand, MOD_RESULT, (source, cmd, params)); if (MOD_RESULT == EVENT_STOP) return; @@ -169,7 +166,7 @@ class BotServCore : public Module cmd->Execute(source, params); if (!nc_reference) source.nc = NULL; - FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, cmd, params)); + FOREACH_MOD(OnPostCommand, (source, cmd, params)); } void OnJoinChannel(User *user, Channel *c) anope_override diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 5a1fed00b..116d5a5ac 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -20,11 +20,6 @@ class ChanServCore : public Module, public ChanServService ChanServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR), ChanServService(this) { - Implementation i[] = { I_OnReload, I_OnBotDelete, I_OnBotPrivmsg, I_OnDelCore, - I_OnPreHelp, I_OnPostHelp, I_OnCheckModes, I_OnCreateChan, I_OnCanSet, - I_OnChannelSync, I_OnBotKick, I_OnExpireTick, I_OnCheckDelete, I_OnPreUplinkSync, - I_OnChanRegistered, I_OnTopicUpdated }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void Hold(Channel *c) anope_override @@ -360,7 +355,7 @@ class ChanServCore : public Module, public ChanServService if (ci->HasExt("NO_EXPIRE")) expire = false; - FOREACH_MOD(I_OnPreChanExpire, OnPreChanExpire(ci, expire)); + FOREACH_MOD(OnPreChanExpire, (ci, expire)); if (expire) { @@ -369,7 +364,7 @@ class ChanServCore : public Module, public ChanServService extra = "suspended "; Log(LOG_NORMAL, "chanserv/expire") << "Expiring " << extra << "channel " << ci->name << " (founder: " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << ")"; - FOREACH_MOD(I_OnChanExpire, OnChanExpire(ci)); + FOREACH_MOD(OnChanExpire, (ci)); delete ci; } } diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index 224cbeea1..1500ebb17 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -27,8 +27,6 @@ class GlobalCore : public Module, public GlobalService GlobalCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR), GlobalService(this) { - Implementation i[] = { I_OnReload, I_OnRestart, I_OnShutdown, I_OnNewServer, I_OnPreHelp }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void SendGlobal(const BotInfo *sender, const Anope::string &source, const Anope::string &message) anope_override diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp index 7c98c7344..31b623895 100644 --- a/modules/pseudoclients/hostserv.cpp +++ b/modules/pseudoclients/hostserv.cpp @@ -17,13 +17,8 @@ class HostServCore : public Module public: HostServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR) { - if (!IRCD || !IRCD->CanSetVHost) throw ModuleException("Your IRCd does not support vhosts"); - - Implementation i[] = { I_OnReload, I_OnNickIdentify, I_OnNickUpdate, I_OnPreHelp, - I_OnSetVhost, I_OnDeleteVhost }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void OnReload(Configuration::Conf *conf) anope_override diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp index 5136e2af0..e2fa0b0d1 100644 --- a/modules/pseudoclients/memoserv.cpp +++ b/modules/pseudoclients/memoserv.cpp @@ -39,8 +39,6 @@ class MemoServCore : public Module, public MemoServService MemoServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR), MemoServService(this) { - Implementation i[] = { I_OnNickCoreCreate, I_OnCreateChan, I_OnReload, I_OnBotDelete, I_OnNickIdentify, I_OnJoinChannel, I_OnUserAway, I_OnNickUpdate, I_OnPreHelp, I_OnPostHelp }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } MemoResult Send(const Anope::string &source, const Anope::string &target, const Anope::string &message, bool force) anope_override @@ -76,7 +74,7 @@ class MemoServCore : public Module, public MemoServService m->text = message; m->unread = true; - FOREACH_MOD(I_OnMemoSend, OnMemoSend(source, target, mi, m)); + FOREACH_MOD(OnMemoSend, (source, target, mi, m)); if (ischan) { diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 642b22f2d..2e80211b0 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -114,10 +114,6 @@ class NickServCore : public Module, public NickServService public: NickServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR), NickServService(this) { - Implementation i[] = { I_OnReload, I_OnDelNick, I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickIdentify, I_OnNickGroup, - I_OnNickUpdate, I_OnUserConnect, I_OnPostUserLogoff, I_OnServerSync, I_OnUserNickChange, I_OnPreHelp, I_OnPostHelp, - I_OnNickCoreCreate, I_OnUserQuit, I_OnExpireTick, I_OnUserLogin }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } void Validate(User *u) anope_override @@ -285,7 +281,7 @@ class NickServCore : public Module, public NickServService IRCD->SendLogout(user); user->RemoveMode(NickServ, "REGISTERED"); user->Logout(); - FOREACH_MOD(I_OnNickLogout, OnNickLogout(user)); + FOREACH_MOD(OnNickLogout, (user)); } nc->users.clear(); } @@ -510,7 +506,7 @@ class NickServCore : public Module, public NickServService if (na->HasExt("NO_EXPIRE")) expire = false; - FOREACH_MOD(I_OnPreNickExpire, OnPreNickExpire(na, expire)); + FOREACH_MOD(OnPreNickExpire, (na, expire)); if (expire) { @@ -518,7 +514,7 @@ class NickServCore : public Module, public NickServService if (na->nc->HasExt("SUSPENDED")) extra = "suspended "; Log(LOG_NORMAL, "expire") << "Expiring " << extra << "nickname " << na->nick << " (group: " << na->nc->display << ") (e-mail: " << (na->nc->email.empty() ? "none" : na->nc->email) << ")"; - FOREACH_MOD(I_OnNickExpire, OnNickExpire(na)); + FOREACH_MOD(OnNickExpire, (na)); delete na; } } diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp index 85984327c..e0d3ea979 100644 --- a/modules/pseudoclients/operserv.cpp +++ b/modules/pseudoclients/operserv.cpp @@ -159,8 +159,6 @@ class OperServCore : public Module OperServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR), sglines(this), sqlines(this), snlines(this) { - Implementation i[] = { I_OnReload, I_OnBotPrivmsg, I_OnServerQuit, I_OnUserModeSet, I_OnUserModeUnset, I_OnUserConnect, I_OnUserNickChange, I_OnPreHelp, I_OnLog }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); /* Yes, these are in this order for a reason. Most violent->least violent. */ XLineManager::RegisterXLineManager(&sglines); |