HasPrefix is not necessary before TrimPrefix
This commit is contained in:
parent
43fccdbbae
commit
3016635f6a
|
@ -180,9 +180,8 @@ func (daemon *Daemon) ClientRegister(client *Client, command string, cols []stri
|
|||
return
|
||||
}
|
||||
nickname := cols[1]
|
||||
if (strings.HasPrefix(nickname, ":")) {
|
||||
nickname = strings.TrimPrefix(nickname, ":")
|
||||
}
|
||||
// Compatibility with some clients prepending colons to nickname
|
||||
nickname = strings.TrimPrefix(nickname, ":")
|
||||
for existingClient := range daemon.clients {
|
||||
if existingClient.nickname == nickname {
|
||||
client.ReplyParts("433", "*", nickname, "Nickname is already in use")
|
||||
|
|
Loading…
Reference in New Issue