1
0
Fork 0
forked from External/ergo

strings: Fix nick bugs, use UsernameCaseMapped

This commit is contained in:
Daniel Oaks 2017-01-14 02:32:15 +10:00
parent c6e8e4bef3
commit 2b240faa90
4 changed files with 13 additions and 10 deletions

View file

@ -128,13 +128,12 @@ func (clients *ClientLookupSet) Replace(oldNick, newNick string, client *Client)
clients.ByNickMutex.Lock()
defer clients.ByNickMutex.Unlock()
oldClient := clients.getNoMutex(newNick)
if oldClient != nil {
oldClient := clients.ByNick[newNick]
if oldClient == nil || oldClient == client {
// whoo
} else {
return ErrNicknameInUse
}
if oldClient != client {
return ErrNicknameMismatch
}
if oldNick == newNick {
// if they're only changing case, don't need to remove+re-add them