send initialize after initial commands

This commit is contained in:
Liam Stanley 2017-07-18 18:07:42 -04:00
parent 0029c297f1
commit 76843d6b84

@ -304,9 +304,6 @@ func (c *Client) internalConnect(mock net.Conn) error {
go c.pingLoop(errs, done, &wg) go c.pingLoop(errs, done, &wg)
} }
// Send a virtual event allowing hooks for successful socket connection.
c.RunHandlers(&Event{Command: INITIALIZED, Trailing: c.Server()})
// Passwords first. // Passwords first.
if c.Config.ServerPass != "" { if c.Config.ServerPass != "" {
c.write(&Event{Command: PASS, Params: []string{c.Config.ServerPass}, Sensitive: true}) c.write(&Event{Command: PASS, Params: []string{c.Config.ServerPass}, Sensitive: true})
@ -326,6 +323,9 @@ func (c *Client) internalConnect(mock net.Conn) error {
// support. // support.
c.listCAP() c.listCAP()
// Send a virtual event allowing hooks for successful socket connection.
c.RunHandlers(&Event{Command: INITIALIZED, Trailing: c.Server()})
// Wait for the first error. // Wait for the first error.
var result error var result error
select { select {