From 4350b92bef792e029652f0f7c4f0983f87ee1fce Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 30 May 2019 18:48:12 -0400 Subject: [PATCH] fix KILL etc. for BRB'ed clients --- irc/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index 3d920910..07a761c3 100644 --- a/irc/client.go +++ b/irc/client.go @@ -985,7 +985,9 @@ func (client *Client) destroy(session *Session) { } // should we destroy the whole client this time? - shouldDestroy := !client.destroyed && remainingSessions == 0 && (brbState != BrbEnabled && brbState != BrbSticky) + // BRB is not respected if this is a destroy of the whole client (i.e., session == nil) + brbEligible := session != nil && (brbState == BrbEnabled || brbState == BrbSticky) + shouldDestroy := !client.destroyed && remainingSessions == 0 && !brbEligible if shouldDestroy { // if it's our job to destroy it, don't let anyone else try client.destroyed = true