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

Move some of CheckKick to the respective modules

This commit is contained in:
Adam
2012-12-28 15:59:33 -05:00
parent 761849083d
commit 6b1f323bb5
6 changed files with 83 additions and 70 deletions
+12 -1
View File
@@ -1166,7 +1166,7 @@ class CSSet : public Module
{
this->SetAuthor("Anope");
Implementation i[] = { I_OnReload, I_OnChanRegistered };
Implementation i[] = { I_OnReload, I_OnChanRegistered, I_OnCheckKick };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
this->OnReload();
@@ -1183,6 +1183,17 @@ class CSSet : public Module
if (CSDefChanstats)
ci->SetFlag(CI_STATS);
}
EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) anope_override
{
if (!ci->HasFlag(CI_RESTRICTED) || ci->c->MatchesList(u, CMODE_EXCEPT))
return EVENT_CONTINUE;
if (ci->AccessFor(u).empty() && (!ci->GetFounder() || u->Account() != ci->GetFounder()))
return EVENT_STOP;
return EVENT_CONTINUE;
}
};
MODULE_INIT(CSSet)