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
|
return
|
||||||
}
|
}
|
||||||
nickname := cols[1]
|
nickname := cols[1]
|
||||||
if (strings.HasPrefix(nickname, ":")) {
|
// Compatibility with some clients prepending colons to nickname
|
||||||
nickname = strings.TrimPrefix(nickname, ":")
|
nickname = strings.TrimPrefix(nickname, ":")
|
||||||
}
|
|
||||||
for existingClient := range daemon.clients {
|
for existingClient := range daemon.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")
|
||||||
|
Loading…
Reference in New Issue
Block a user