diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd_nick.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp index 10add019f..4eb439895 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -104,27 +104,25 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) } } - if (user->registered == REG_ALL) - { - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(user,parameters[0])); - if (MOD_RESULT) { - // if a module returns true, the nick change is silently forbidden. - return CMD_FAILURE; - } + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(user,parameters[0])); + if (MOD_RESULT) + // if a module returns true, the nick change is silently forbidden. + return CMD_FAILURE; + if (user->registered == REG_ALL) user->WriteCommon("NICK %s",parameters[0]); - } - strlcpy(oldnick, user->nick, NICKMAX - 1); /* change the nick of the user in the users_hash */ user = user->UpdateNickHash(parameters[0]); /* actually change the nick within the record */ - if (!user) return CMD_FAILURE; - if (!*user->nick) return CMD_FAILURE; + if (!user) + return CMD_FAILURE; + if (!*user->nick) + return CMD_FAILURE; strlcpy(user->nick, parameters[0], NICKMAX - 1); |