summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-20 09:51:21 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-20 09:51:21 +0000
commite587b9efef09ca2cbb8873dd8cb2941ad74bda42 (patch)
tree35457482ec7f1b14212c7bf9dc3454b07ac339ae /src
parent53aaf31285c1168b1d0d1aca5e67b6323b0d0910 (diff)
Fixed case-change nicks not being propogated
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2583 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/cmd_nick.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp
index f35a8fd8c..33960463b 100644
--- a/src/cmd_nick.cpp
+++ b/src/cmd_nick.cpp
@@ -65,6 +65,8 @@ extern userrec* fd_ref_table[65536];
void cmd_nick::Handle (char **parameters, int pcnt, userrec *user)
{
+ char oldnick[NICKMAX];
+
if (pcnt < 1)
{
log(DEBUG,"not enough params for handle_nick");
@@ -92,10 +94,16 @@ void cmd_nick::Handle (char **parameters, int pcnt, userrec *user)
}
if (irc::string(user->nick) == irc::string(parameters[0]))
{
- log(DEBUG,"old nick is new nick, skipping");
+ log(DEBUG,"old nick is new nick, not updating hash (case change only)");
+ strlcpy(oldnick,user->nick,NICKMAX);
+ int MOD_RESULT = 0;
+ FOREACH_RESULT(OnUserPreNick(user,parameters[0]));
+ if (MOD_RESULT)
+ return;
strlcpy(user->nick,parameters[0],NICKMAX);
if (user->registered == 7)
WriteCommon(user,"NICK %s",parameters[0]);
+ FOREACH_MOD OnUserPostNick(user,oldnick);
return;
}
else
@@ -137,8 +145,7 @@ void cmd_nick::Handle (char **parameters, int pcnt, userrec *user)
WriteCommon(user,"NICK %s",parameters[0]);
}
-
- char oldnick[NICKMAX];
+
strlcpy(oldnick,user->nick,NICKMAX);
/* change the nick of the user in the users_hash */