Force lowercase nicknames

This commit is contained in:
Sergey Matveev 2015-11-05 17:04:52 +03:00
parent b640107b1f
commit f93640a335

View File

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