summaryrefslogtreecommitdiff
path: root/src/coremods/core_user/cmd_user.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-03 12:16:07 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-03 12:16:07 +0200
commit4332765b27b8b10e4f450bbdf8ddb50dc6cfca43 (patch)
treef13f9c85df0c915b7fee15bfd7335633652242b0 /src/coremods/core_user/cmd_user.cpp
parent4ab1eb3d1e54d205317dafad538138bb40feace9 (diff)
core_user Deduplicate code that calls the OnUserRegister hook
Diffstat (limited to 'src/coremods/core_user/cmd_user.cpp')
-rw-r--r--src/coremods/core_user/cmd_user.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp
index 6de762e44..d593d7f4b 100644
--- a/src/coremods/core_user/cmd_user.cpp
+++ b/src/coremods/core_user/cmd_user.cpp
@@ -62,15 +62,19 @@ CmdResult CommandUser::HandleLocal(const std::vector<std::string>& parameters, L
}
/* 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;