]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_user/cmd_user.cpp
core_whois Fix numeric 319 not obeying MaxLine
[user/henk/code/inspircd.git] / src / coremods / core_user / cmd_user.cpp
index 6de762e449067d16a07d73e91700ee3e291b032c..cbf4f5e08b97ae1487561c28946d96304ca06ec2 100644 (file)
@@ -58,19 +58,24 @@ CmdResult CommandUser::HandleLocal(const std::vector<std::string>& parameters, L
        else
        {
                user->WriteNumeric(ERR_ALREADYREGISTERED, ":You may not reregister");
+               user->CommandFloodPenalty += 1000;
                return CMD_FAILURE;
        }
 
        /* parameters 2 and 3 are local and remote hosts, and are ignored */
+       return CheckRegister(user);
+}
+
+CmdResult CommandUser::CheckRegister(LocalUser* user)
+{
+       // If the user is registered, return CMD_SUCCESS/CMD_FAILURE depending on what modules say, otherwise just
+       // return CMD_SUCCESS without doing anything, knowing the other handler will call us again
        if (user->registered == REG_NICKUSER)
        {
                ModResult MOD_RESULT;
-
-               /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */
                FIRST_MOD_RESULT(OnUserRegister, MOD_RESULT, (user));
                if (MOD_RESULT == MOD_RES_DENY)
                        return CMD_FAILURE;
-
        }
 
        return CMD_SUCCESS;