diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-07 20:56:10 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-07 20:56:10 +0000 |
commit | c30f0ef741528231aefaa3b284f3ac161b1ca86c (patch) | |
tree | 93e40a297b195c08371f89f3e43b10a29d82b9b4 /src/users.cpp | |
parent | be28c7f3c74f5f856be74ebef88316bc69c583b9 (diff) |
userrec::ForceNickChange was broken (not the entire nickchange system as i'd suspected at first)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5156 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
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 (...) |