summaryrefslogtreecommitdiff
path: root/modules/commands/cs_set.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-28 15:59:33 -0500
committerAdam <Adam@anope.org>2012-12-28 15:59:33 -0500
commit6b1f323bb519009048a94c8bb3d003288a339345 (patch)
treeb30ad2793adca8e63f9de0b8a45295a4f3d56dea /modules/commands/cs_set.cpp
parent761849083da3a523eeb3b2293311cfee1c29df35 (diff)
Move some of CheckKick to the respective modules
Diffstat (limited to 'modules/commands/cs_set.cpp')
-rw-r--r--modules/commands/cs_set.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index 5ac235c8f..48cad51af 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -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)