diff --git a/client/connection.go b/client/connection.go index e1128a2..1cd0ece 100644 --- a/client/connection.go +++ b/client/connection.go @@ -171,6 +171,7 @@ func (conn *Conn) Connect(host string, pass ...string) error { conn.password = "" } conn.postConnect() + conn.dispatch(&Line{Cmd: INIT}) return nil } @@ -188,7 +189,6 @@ func (conn *Conn) postConnect() { go func() { <-conn.cPing }() } go conn.runLoop() - conn.dispatch(&Line{Cmd: INIT}) } // copied from http.client for great justice diff --git a/client/connection_test.go b/client/connection_test.go index e4d09ba..f03dc4e 100644 --- a/client/connection_test.go +++ b/client/connection_test.go @@ -33,9 +33,6 @@ func setUp(t *testing.T, start ...bool) (*Conn, *testState) { // Hack to allow tests of send, recv, write etc. // NOTE: the value of the boolean doesn't matter. c.postConnect() - // All connections start with NICK/USER expect these. - nc.Expect("NICK test") - nc.Expect("USER test 12 * :Testing IRC") // Sleep 1ms to allow background routines to start. <-time.After(1e6)