1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 16:43:13 +02:00

Initially attach all modules to all events, and detach them as the events are run if they are not implemented per module

This commit is contained in:
Adam
2013-05-27 19:36:37 -04:00
parent c21e8d9204
commit 37b3535543
120 changed files with 440 additions and 672 deletions
+2 -7
View File
@@ -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;
}
}