From e587b9efef09ca2cbb8873dd8cb2941ad74bda42 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 20 Dec 2005 09:51:21 +0000 Subject: Fixed case-change nicks not being propogated git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2583 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_nick.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3