From f277be0f2634cc97881918a0aaf1c0cb6ffad2d6 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 14 Jul 2011 21:40:21 -0400 Subject: Fixed OSOpersOnly & CSOpersOnly --- modules/core/cs_main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'modules/core/cs_main.cpp') 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) -- cgit