]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_nick.cpp
This fixes a deletion error here, we were using new[] and not using delete[], but...
[user/henk/code/inspircd.git] / src / cmd_nick.cpp
index 10add019f3fac4d479b2f24219f4505a722ece81..4eb439895f581d8ef8c5c7241b6239ea5fc6b7be 100644 (file)
@@ -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);