diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:49:36 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:49:36 +0000 |
commit | 86775e2e98f55b3b88befe2daff0ca23f02f3155 (patch) | |
tree | cbc3abf3f55ae6fd1112bcf6bf44e02b502ac2d6 /src/command_parse.cpp | |
parent | 3d8ec5dbd9cfde34fcbc63ad7b9b1369866f0a33 (diff) |
ModResult conversion: Change return type of all module functions
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11634 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index e7478478a..1ca4c988f 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -28,15 +28,15 @@ int InspIRCd::PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype) { - int MOD_RESULT = 0; - FOREACH_RESULT_I(this,I_OnPassCompare,OnPassCompare(ex, data, input, hashtype)) + ModResult res; + FIRST_MOD_RESULT(this, OnPassCompare, res, (ex, data, input, hashtype)); /* Module matched */ - if (MOD_RESULT == 1) + if (res == MOD_RES_ALLOW) return 0; /* Module explicitly didnt match */ - if (MOD_RESULT == -1) + if (res == MOD_RES_DENY) return 1; /* We dont handle any hash types except for plaintext - Thanks tra26 */ @@ -278,9 +278,9 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) if (cm == cmdlist.end()) { - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); - if (MOD_RESULT == 1) + ModResult MOD_RESULT; + FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd)); + if (MOD_RESULT == MOD_RES_DENY) return true; /* @@ -341,9 +341,9 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) * We call OnPreCommand here seperately if the command exists, so the magic above can * truncate to max_params if necessary. -- w00t */ - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); - if (MOD_RESULT == 1) + ModResult MOD_RESULT; + FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd)); + if (MOD_RESULT == MOD_RES_DENY) return true; /* activity resets the ping pending timer */ @@ -399,9 +399,8 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) cm->second->total_bytes += cmd.length(); /* module calls too */ - MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, true, cmd)); - if (MOD_RESULT == 1) + FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, true, cmd)); + if (MOD_RESULT == MOD_RES_DENY) return do_more; /* |