X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=abe0f8804b4f7765281387f2b943741aa6d0cfa5;hb=acccaa39641500b8a691db4136e6571102a438ed;hp=b52ca9aa3cd623e10e3271c51584e6764099cbbd;hpb=43063e15a27298a89c4f1ca592747fc417fa11b5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index b52ca9aa3..abe0f8804 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -619,7 +619,8 @@ bool User::ChangeNick(const std::string& newnick, time_t newts) return false; } - if (assign(newnick) == assign(nick)) + User* const InUse = ServerInstance->FindNickOnly(newnick); + if (InUse == this) { // case change, don't need to check campers // and, if it's identical including case, we can leave right now @@ -638,8 +639,7 @@ bool User::ChangeNick(const std::string& newnick, time_t newts) * If the guy using the nick is already using it, tell the incoming nick change to gtfo, * because the nick is already (rightfully) in use. -- w00t */ - User* InUse = ServerInstance->FindNickOnly(newnick); - if (InUse && (InUse != this)) + if (InUse) { if (InUse->registered != REG_ALL) {