mirror of
https://github.com/fluffle/goirc
synced 2025-05-18 13:33:20 +00:00
Merge pull request #55 from StalkR/disconnected
client/connection: keep information in disconnected event, revert #43
This commit is contained in:
commit
a3debed539
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue