Force lowercase nicknames

This commit is contained in:
Sergey Matveev 2015-11-05 17:04:52 +03:00 committed by User Mue
parent e354be7595
commit 5413b3ae52

View File

@ -162,6 +162,7 @@ func ClientRegister(client *Client, cmd string, cols []string) {
nickname := cols[1]
// Compatibility with some clients prepending colons to nickname
nickname = strings.TrimPrefix(nickname, ":")
nickname = strings.ToLower(nickname)
for existingClient := range clients {
if *existingClient.nickname == nickname {
client.ReplyParts("433", "*", nickname, "Nickname is already in use")