summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-07 18:49:28 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-07 18:49:28 +0000
commit2e03f561b994f634cd87d7ab2c19310349101b77 (patch)
tree01bd3e4ac95126a7cda018911325dc0c0bc2605d /src
parentcb947156cc40a4eff0dc95e6e232c057e0c20220 (diff)
This should fix m_svshold to not allow the nick to be taken on connect
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8136 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/cmd_nick.cpp22
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);