mirror of https://github.com/fluffle/goirc
client/connection: keep information in disconnected event
This commit is contained in:
parent
2e39250355
commit
262ea31065
|
@ -403,9 +403,11 @@ func (conn *Conn) shutdown() {
|
||||||
conn.sock.Close()
|
conn.sock.Close()
|
||||||
close(conn.die)
|
close(conn.die)
|
||||||
conn.wg.Wait()
|
conn.wg.Wait()
|
||||||
|
// Dispatch after closing connection but before reinit
|
||||||
|
// so event handlers can still access state information.
|
||||||
|
conn.dispatch(&Line{Cmd: DISCONNECTED, Time: time.Now()})
|
||||||
// reinit datastructures ready for next connection
|
// reinit datastructures ready for next connection
|
||||||
conn.initialise()
|
conn.initialise()
|
||||||
conn.dispatch(&Line{Cmd: DISCONNECTED, Time: time.Now()})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dumps a load of information about the current state of the connection to a
|
// Dumps a load of information about the current state of the connection to a
|
||||||
|
|
Loading…
Reference in New Issue