summaryrefslogtreecommitdiff
path: root/modules/core/os_main.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-07-14 21:40:21 -0400
committerAdam <Adam@anope.org>2011-07-14 21:40:21 -0400
commitf277be0f2634cc97881918a0aaf1c0cb6ffad2d6 (patch)
tree6fed92bbd138782cdfe53f17cbc229c6c02afbd5 /modules/core/os_main.cpp
parent1a2486d2ece150b2f567679d230f0e5f50e4405c (diff)
Fixed OSOpersOnly & CSOpersOnly
Diffstat (limited to 'modules/core/os_main.cpp')
-rw-r--r--modules/core/os_main.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/core/os_main.cpp b/modules/core/os_main.cpp
index e8d1f5e28..bfb7ddfe6 100644
--- a/modules/core/os_main.cpp
+++ b/modules/core/os_main.cpp
@@ -292,8 +292,8 @@ class OperServCore : public Module
if (OperServ == NULL)
throw ModuleException("No bot named " + Config->OperServ);
- Implementation i[] = { I_OnServerQuit, I_OnUserModeSet, I_OnUserModeUnset, I_OnUserConnect, I_OnUserNickChange, I_OnPreHelp };
- ModuleManager::Attach(i, this, 6);
+ Implementation i[] = { I_OnBotPrivmsg, I_OnServerQuit, I_OnUserModeSet, I_OnUserModeUnset, I_OnUserConnect, I_OnUserNickChange, I_OnPreHelp };
+ ModuleManager::Attach(i, this, 7);
ModuleManager::RegisterService(&sglines);
ModuleManager::RegisterService(&szlines);
@@ -307,6 +307,17 @@ class OperServCore : public Module
XLineManager::RegisterXLineManager(&snlines);
}
+ EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message)
+ {
+ if (Config->OSOpersOnly && !u->HasMode(UMODE_OPER) && bi->nick == Config->OperServ)
+ {
+ u->SendMessage(bi, ACCESS_DENIED);
+ return EVENT_STOP;
+ }
+
+ return EVENT_CONTINUE;
+ }
+
void OnServerQuit(Server *server)
{
if (server->HasFlag(SERVER_JUPED))