diff options
-rw-r--r-- | src/cmd_nick.cpp | 8 | ||||
-rw-r--r-- | src/users.cpp | 17 |
2 files changed, 8 insertions, 17 deletions
diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp index 10d95ed46..a2337ba08 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -32,7 +32,7 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) { char oldnick[NICKMAX]; - if (!*parameters[0]) + if (!parameters[0][0]) { ServerInstance->Log(DEBUG,"zero length new nick passed to handle_nick"); return CMD_FAILURE; @@ -42,11 +42,13 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) ServerInstance->Log(DEBUG,"invalid old nick passed to handle_nick"); return CMD_FAILURE; } + ServerInstance->Log(DEBUG,"Fall through"); if (irc::string(user->nick) == irc::string(parameters[0])) { /* If its exactly the same, even case, dont do anything. */ if (!strcmp(user->nick,parameters[0])) return CMD_SUCCESS; + /* Its a change of case. People insisted that they should be * able to do silly things like this even though the RFC says * the nick AAA is the same as the nick aaa. @@ -65,10 +67,6 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) } else { - if ((*parameters[0] == ':') && (*(parameters[0]+1) != 0)) - { - parameters[0]++; - } char* mq = ServerInstance->XLines->matches_qline(parameters[0]); if (mq) { diff --git a/src/users.cpp b/src/users.cpp index bfecd744c..f8b8efeb0 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1169,13 +1169,10 @@ bool userrec::ForceNickChange(const char* newnick) { try { - char nick[MAXBUF]; int MOD_RESULT = 0; - - *nick = 0; FOREACH_RESULT(I_OnUserPreNick,OnUserPreNick(this, newnick)); - + if (MOD_RESULT) { ServerInstance->stats->statsCollisions++; @@ -1187,19 +1184,15 @@ bool userrec::ForceNickChange(const char* newnick) ServerInstance->stats->statsCollisions++; return false; } - - if (newnick) - { - strlcpy(this->nick, newnick, NICKMAX - 1); - } + if (this->registered == REG_ALL) { const char* pars[1]; - pars[0] = nick; + pars[0] = newnick; std::string cmd = "NICK"; - ServerInstance->Parser->CallHandler(cmd, pars, 1, this); + return (ServerInstance->Parser->CallHandler(cmd, pars, 1, this) == CMD_SUCCESS); } - return true; + return false; } catch (...) |