Handle nick collisions by right-padding with _

This commit is contained in:
Ken-Håvard Lieng 2017-04-06 23:26:58 +02:00
parent 50dc0ef64f
commit 961c0415a0
8 changed files with 51 additions and 27 deletions

View file

@ -21,6 +21,7 @@ type Client struct {
Realname string
Messages chan *Message
ConnectionChanged chan bool
HandleNickInUse func(string) string
nick string
channels []string

View file

@ -188,6 +188,12 @@ func (c *Client) recv() {
case ReplyWelcome:
c.once.Do(c.ready.Done)
case "433":
if c.HandleNickInUse != nil {
c.nick = c.HandleNickInUse(c.nick)
c.writeNick(c.nick)
}
}
}
}