From e105d9d1c0ec0200163ef50bbcee80f7f6b779a9 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 7 Oct 2007 18:50:09 +0000 Subject: 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 --- src/cmd_nick.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/cmd_nick.cpp') 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); -- cgit v1.3.1-10-gc9f91