From ecd5b4082a7ef4ae89116761c77285ed77b7a794 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 6 Sep 2006 18:20:02 +0000 Subject: 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 --- src/command_parse.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/command_parse.cpp') 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::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 -- cgit v1.3.1-10-gc9f91