diff options
author | Peter Powell <petpow@saberuk.com> | 2014-01-18 04:53:52 +0000 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-25 12:20:04 +0100 |
commit | 074727e7a74f8dcef6c250faf6a757f0274d27db (patch) | |
tree | ad38267d13fd59936770ee2b20e018b57d56852e /src/command_parse.cpp | |
parent | 48869b38e938de4d8dd4cdff486b10348e81f7b6 (diff) |
Convert InspIRCd::PassCompare to return bool instead of int.
The insane behaviour of this method was due to an implementation
detail which has since become irrelevent.
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 20977995b..66b8dcd67 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -23,25 +23,24 @@ #include "inspircd.h" -int InspIRCd::PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype) +bool InspIRCd::PassCompare(Extensible* ex, const std::string& data, const std::string& input, const std::string& hashtype) { ModResult res; FIRST_MOD_RESULT(OnPassCompare, res, (ex, data, input, hashtype)); /* Module matched */ if (res == MOD_RES_ALLOW) - return 0; + return true; /* Module explicitly didnt match */ if (res == MOD_RES_DENY) - return 1; + return false; /* We dont handle any hash types except for plaintext - Thanks tra26 */ if (!hashtype.empty() && hashtype != "plaintext") - /* See below. 1 because they dont match */ - return 1; + return false; - return (data != input); // this seems back to front, but returns 0 if they *match*, 1 else + return (data == input); } bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std::string>& parameters, unsigned int splithere, int extra, bool usemax) |