From 76843d6b84a2db9eb29c8443ee8197b16bf596ea Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Tue, 18 Jul 2017 18:07:42 -0400 Subject: [PATCH] send initialize after initial commands --- conn.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conn.go b/conn.go index cce6ab5..ac290ba 100644 --- a/conn.go +++ b/conn.go @@ -304,9 +304,6 @@ func (c *Client) internalConnect(mock net.Conn) error { 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. if c.Config.ServerPass != "" { 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. 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. var result error select {