mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
review fixes
This commit is contained in:
parent
9ed789f67c
commit
754fb79cdd
2 changed files with 15 additions and 25 deletions
|
|
@ -142,7 +142,7 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
|||
return "", errNickMissing, false
|
||||
}
|
||||
|
||||
if account == "" && config.Accounts.NickReservation.ForceGuestFormat {
|
||||
if account == "" && config.Accounts.NickReservation.ForceGuestFormat && !dryRun {
|
||||
newCfNick, err = CasefoldName(newNick)
|
||||
if err != nil {
|
||||
return "", errNicknameInvalid, false
|
||||
|
|
@ -199,9 +199,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
|||
|
||||
currentClient := clients.byNick[newCfNick]
|
||||
// the client may just be changing case
|
||||
if currentClient != nil && currentClient != client && session != nil {
|
||||
if currentClient != nil && currentClient != client {
|
||||
// these conditions forbid reattaching to an existing session:
|
||||
if registered || !bouncerAllowed || account == "" || account != currentClient.Account() {
|
||||
if registered || !bouncerAllowed || account == "" || account != currentClient.Account() ||
|
||||
dryRun || session == nil {
|
||||
return "", errNicknameInUse, false
|
||||
}
|
||||
// check TLS modes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue