Rejoin channels after reconnecting

This commit is contained in:
Ken-Håvard Lieng 2016-02-03 21:12:32 +01:00
parent 90b74ee022
commit 875f5fafe3
3 changed files with 35 additions and 1 deletions

View file

@ -93,6 +93,8 @@ func (c *Client) tryConnect() {
err := c.connect()
if err == nil {
c.backoff.Reset()
c.flushChannels()
return
}
@ -179,6 +181,11 @@ func (c *Client) recv() {
case Ping:
go c.write("PONG :" + msg.Trailing)
case Join:
if msg.Nick == c.GetNick() {
c.addChannel(msg.Params[0])
}
case ReplyWelcome:
c.once.Do(c.ready.Done)
}