summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/command_parse.h8
-rw-r--r--include/modules.h19
2 files changed, 22 insertions, 5 deletions
diff --git a/include/command_parse.h b/include/command_parse.h
index 635db619c..40c3425fb 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -96,9 +96,13 @@ class CommandParser : public classbase
* @param parameters Parameter list as an array of array of char (that's not a typo).
* @param pcnt The number of items in the parameters list
* @param user The user to call the handler on behalf of
- * @return This method will return true if the command handler was found and called
+ * @return This method will return CMD_SUCCESS if the command handler was found and called,
+ * and the command completeld successfully. It will return CMD_FAILURE if the command handler was found
+ * and called, but the command did not complete successfully, and it will return CMD_INVALID if the
+ * command simply did not exist at all or the wrong number of parameters were given, or the user
+ * was not privilaged enough to execute the command.
*/
- bool CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user);
+ CmdResult CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user);
/** This function returns true if a command is valid with the given number of parameters and user.
* @param commandname The command name to check
diff --git a/include/modules.h b/include/modules.h
index 2754a42c2..c497155ad 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -342,7 +342,7 @@ enum Implementation { I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse
I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan,
I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
- I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList };
+ I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList, I_OnPostCommand };
/** Base class for all InspIRCd modules
* This class is the base class for InspIRCd modules. All modules must inherit from this class,
@@ -985,8 +985,8 @@ class Module : public Extensible
/** Called whenever any command is about to be executed.
* This event occurs for all registered commands, wether they are registered in the core,
- * or another module, but it will not occur for invalid commands (e.g. ones which do not
- * exist within the command table). By returning 1 from this method you may prevent the
+ * or another module, and for invalid commands. Invalid commands may only be sent to this
+ * function when the value of validated is false. By returning 1 from this method you may prevent the
* command being executed. If you do this, no output is created by the core, and it is
* down to your module to produce any output neccessary.
* Note that unless you return 1, you should not destroy any structures (e.g. by using
@@ -1001,6 +1001,19 @@ class Module : public Extensible
*/
virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated);
+ /** Called after any command has been executed.
+ * This event occurs for all registered commands, wether they are registered in the core,
+ * or another module, but it will not occur for invalid commands (e.g. ones which do not
+ * exist within the command table). The result code returned by the command handler is
+ * provided.
+ * @param command The command being executed
+ * @param parameters An array of array of characters containing the parameters for the command
+ * @param pcnt The nuimber of parameters passed to the command
+ * @param user the user issuing the command
+ * @param result The return code given by the command handler, one of CMD_SUCCESS or CMD_FAILURE
+ */
+ virtual void OnPostCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, CmdResult result);
+
/** Called to check if a user who is connecting can now be allowed to register
* If any modules return false for this function, the user is held in the waiting
* state until all modules return true. For example a module which implements ident