summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/chanserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-26 23:23:15 -0500
committerAdam <Adam@anope.org>2012-02-26 23:23:15 -0500
commita5b9e235ae240439608aa743c9ebb3bf6e7d342a (patch)
tree9c3040b865ace191c224a94ef525ab60581c6ba5 /modules/pseudoclients/chanserv.cpp
parenta78790eac4da788a8432d0b83fa72de7853dd697 (diff)
Added chanserv:require config option to set which modes must be on all registered channels. Prevents the core from always enforcing +r on every channel, even if chanserv is not loaded.
Diffstat (limited to 'modules/pseudoclients/chanserv.cpp')
-rw-r--r--modules/pseudoclients/chanserv.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp
index b5deaf284..f1ad3ec6a 100644
--- a/modules/pseudoclients/chanserv.cpp
+++ b/modules/pseudoclients/chanserv.cpp
@@ -65,7 +65,7 @@ class ChanServCore : public Module
if (ChanServ == NULL)
throw ModuleException("No bot named " + Config->ChanServ);
- Implementation i[] = { I_OnBotPrivmsg, I_OnDelCore, I_OnPreHelp, I_OnPostHelp };
+ Implementation i[] = { I_OnBotPrivmsg, I_OnDelCore, I_OnPreHelp, I_OnPostHelp, I_OnCheckModes };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
@@ -179,6 +179,17 @@ class ChanServCore : public Module
"any channel, view (and modify) the access, levels and akick\n"
"lists and settings for any channel."));
}
+
+ EventReturn OnCheckModes(Channel *c) anope_override
+ {
+ if (!Config->CSRequire.empty())
+ if (c->ci)
+ c->SetModes(NULL, false, "+%s", Config->CSRequire.c_str());
+ else
+ c->SetModes(NULL, false, "-%s", Config->CSRequire.c_str());
+
+ return EVENT_CONTINUE;
+ }
};
MODULE_INIT(ChanServCore)