diff options
author | Adam <Adam@anope.org> | 2011-07-14 21:40:21 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-07-14 21:40:21 -0400 |
commit | f277be0f2634cc97881918a0aaf1c0cb6ffad2d6 (patch) | |
tree | 6fed92bbd138782cdfe53f17cbc229c6c02afbd5 /modules/core/cs_main.cpp | |
parent | 1a2486d2ece150b2f567679d230f0e5f50e4405c (diff) |
Fixed OSOpersOnly & CSOpersOnly
Diffstat (limited to 'modules/core/cs_main.cpp')
-rw-r--r-- | modules/core/cs_main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/core/cs_main.cpp b/modules/core/cs_main.cpp index 1aa346d41..8c1678624 100644 --- a/modules/core/cs_main.cpp +++ b/modules/core/cs_main.cpp @@ -24,8 +24,19 @@ class ChanServCore : public Module if (ChanServ == NULL) throw ModuleException("No bot named " + Config->ChanServ); - Implementation i[] = { I_OnDelChan, I_OnPreHelp, I_OnPostHelp }; - ModuleManager::Attach(i, this, 3); + Implementation i[] = { I_OnBotPrivmsg, I_OnDelChan, I_OnPreHelp, I_OnPostHelp }; + ModuleManager::Attach(i, this, 4); + } + + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) + { + if (Config->CSOpersOnly && !u->HasMode(UMODE_OPER) && bi->nick == Config->ChanServ) + { + u->SendMessage(bi, ACCESS_DENIED); + return EVENT_STOP; + } + + return EVENT_CONTINUE; } void OnDelCore(NickCore *nc) |