summaryrefslogtreecommitdiff
path: root/src/commands.c
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-30 01:04:13 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-30 01:04:13 +0000
commit6a9fa9f4d2ead592eb51a014491ce3aaee2029e8 (patch)
tree454479f2c8ef69a52e461416be42fd94d8b15955 /src/commands.c
parent5fc268b7509f20cbf1243b99f2669033b93db00e (diff)
Rewrote all of the defcon code, and moved most of it to os_defcon. This fixes defcon to have the ability to use modes introduced to Anope at a later time than on startup (eg, from the IRCd), amongst other things
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2597 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/commands.c')
-rw-r--r--src/commands.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/commands.c b/src/commands.c
index 960f5ac06..9247307a3 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -54,25 +54,18 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
Command *c = findCommand(cmdTable, cmd);
int retVal = MOD_CONT;
ChannelInfo *ci;
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnPreCommandRun, OnPreCommandRun(service, u, cmd, c));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
if (!c)
{
- if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u))
- {
- notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service);
- }
+ notice_lang(service, u, UNKNOWN_COMMAND_HELP, cmd, service);
return;
}
- if ((checkDefCon(DEFCON_OPER_ONLY) || checkDefCon(DEFCON_SILENT_OPER_ONLY)) && !is_oper(u))
- {
- if (!checkDefCon(DEFCON_SILENT_OPER_ONLY))
- {
- notice_lang(service, u, OPER_DEFCON_DENIED);
- return;
- }
- }
-
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED))
{
// Command requires registered users only
@@ -120,7 +113,6 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
return;
}
- EventReturn MOD_RESULT = EVENT_CONTINUE;
FOREACH_RESULT(I_OnPreCommand, OnPreCommand(u, c->service, c->name.c_str(), params));
if (MOD_RESULT == EVENT_STOP)
return;