1
0
Fork 0
forked from External/ergo

review fixes

This commit is contained in:
Shivaram Lingamneni 2020-10-07 08:54:46 -04:00
parent 9ed789f67c
commit 754fb79cdd
2 changed files with 15 additions and 25 deletions

View file

@ -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