From 2e2e91689a5aaca133e5f989a830ca7f421b36db Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Tue, 29 Nov 2016 19:28:22 +1000 Subject: [PATCH] client: Send quit message to friends correctly --- irc/client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/irc/client.go b/irc/client.go index 08918fcb..e73293f2 100644 --- a/irc/client.go +++ b/irc/client.go @@ -416,6 +416,12 @@ func (client *Client) destroy() { // remove my monitors client.clearMonitorList() + // send quit messages to friends + for friend := range client.Friends() { + //TODO(dan): store quit message in user, if exists use that instead here + friend.Send(nil, client.nickMaskString, "QUIT", "Exited") + } + // clean up channels for channel := range client.channels { channel.Quit(client) @@ -433,10 +439,6 @@ func (client *Client) destroy() { } client.socket.Close() - for friend := range client.Friends() { - //TODO(dan): store quit message in user, if exists use that instead here - friend.Send(nil, client.nickMaskString, "QUIT", "Exited") - } } // SendFromClient sends an IRC line coming from a specific client.