summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-06 18:20:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-06 18:20:02 +0000
commitecd5b4082a7ef4ae89116761c77285ed77b7a794 (patch)
tree60ad1013e3635ec4749559a7632ac6fd812507fe /src/command_parse.cpp
parent71ad308979d9c9129507fdf85d4305fd12e18bea (diff)
Finish off the fix for bug #136 (a biggie for such a simple thing)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5151 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 4c58d9b60..11f4b4635 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -284,7 +284,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, use
// calls a handler function for a command
-bool CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user)
+CmdResult CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user)
{
nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
@@ -298,19 +298,17 @@ bool CommandParser::CallHandler(const std::string &commandname,const char** para
{
if ((user->HasPermission(commandname)) || (!IS_LOCAL(user)))
{
- n->second->Handle(parameters,pcnt,user);
- return true;
+ return n->second->Handle(parameters,pcnt,user);
}
}
else
{
- n->second->Handle(parameters,pcnt,user);
- return true;
+ return n->second->Handle(parameters,pcnt,user);
}
}
}
}
- return false;
+ return CMD_INVALID;
}
void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
@@ -383,8 +381,9 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
* command handler call, as the handler
* may free the user structure!
*/
+ CmdResult result = cm->second->Handle(command_p,items,user);
- cm->second->Handle(command_p,items,user);
+ FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result));
return;
}
else