From 074727e7a74f8dcef6c250faf6a757f0274d27db Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 18 Jan 2014 04:53:52 +0000 Subject: 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. --- src/command_parse.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/command_parse.cpp') 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& parameters, unsigned int splithere, int extra, bool usemax) -- cgit v1.2.3