diff options
| author | 2007-10-07 18:50:09 +0000 | |
|---|---|---|
| committer | 2007-10-07 18:50:09 +0000 | |
| commit | e105d9d1c0ec0200163ef50bbcee80f7f6b779a9 (patch) | |
| tree | d3d50e7f5618b98edefa256ac5615c2442225d58 /src/cmd_nick.cpp | |
| parent | Support 501 numeric (its different for user modes compared to channel modes) ... (diff) | |
Backport r8136, svshold allows nick to be taken on connect (OnUserPreNick not triggering on unregistered user)
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8137 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_nick.cpp')
| -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 4e2ebcf6e..71f7c2d36 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -111,27 +111,25 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) return CMD_FAILURE; } - 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); |
