Reset backoff on RPL_WELCOME

This commit is contained in:
Ken-Håvard Lieng 2019-01-11 05:00:15 +01:00
parent eee260f154
commit 075e404079

View File

@ -120,9 +120,6 @@ func (c *Client) tryConnect() {
return return
} }
} else { } else {
c.backoff.Reset()
c.flushChannels()
return return
} }
@ -194,11 +191,6 @@ func (c *Client) recv() {
default: default:
c.connChange(false, nil) c.connChange(false, nil)
if !c.Registered() {
time.Sleep(15 * time.Second)
}
c.Reconnect() c.Reconnect()
return return
} }
@ -233,6 +225,9 @@ func (c *Client) recv() {
case ReplyWelcome: case ReplyWelcome:
c.setNick(msg.Params[0]) c.setNick(msg.Params[0])
c.setRegistered(true) c.setRegistered(true)
c.flushChannels()
c.backoff.Reset()
c.sendRecv.Add(1) c.sendRecv.Add(1)
go c.send() go c.send()