3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-11 06:29:29 +01:00

review fixes

1. Use FAIL instead of WARN
2. Use NICKNAME_RESERVED instead of ACCOUNT_REQUIRED
3. Don't send 433 at all for registered clients, just send the FAIL
This commit is contained in:
Shivaram Lingamneni 2021-03-18 04:38:28 -04:00
parent 67ee36f1ed
commit 46c32094d7

View File

@ -43,8 +43,10 @@ func performNickChange(server *Server, client *Client, target *Client, session *
}
} else if err == errNicknameReserved {
if !isSanick {
rb.Add(nil, server.name, ERR_NICKNAMEINUSE, details.nick, utils.SafeErrorParam(nickname), client.t("Nickname is reserved by a different account"))
rb.Add(nil, server.name, "WARN", "NICK", "ACCOUNT_REQUIRED", utils.SafeErrorParam(nickname), client.t("Nickname is reserved by a different account"))
if !client.registered {
rb.Add(nil, server.name, ERR_NICKNAMEINUSE, details.nick, utils.SafeErrorParam(nickname), client.t("Nickname is reserved by a different account"))
}
rb.Add(nil, server.name, "FAIL", "NICK", "NICKNAME_RESERVED", utils.SafeErrorParam(nickname), client.t("Nickname is reserved by a different account"))
} else {
rb.Add(nil, server.name, "FAIL", "SANICK", "NICKNAME_RESERVED", utils.SafeErrorParam(nickname), client.t("Nickname is reserved by a different account"))
}