mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
strings: Fix nick bugs, use UsernameCaseMapped
This commit is contained in:
parent
c6e8e4bef3
commit
2b240faa90
4 changed files with 13 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue