From 79b0fe5de592a66249ac8e47c03979a6f0e923de Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 13 Sep 2021 10:33:46 +0200 Subject: [PATCH] Don't send network notification when removed Closes: https://todo.sr.ht/~emersion/soju/123 --- user.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/user.go b/user.go index f220490..2636ce3 100644 --- a/user.go +++ b/user.go @@ -674,6 +674,19 @@ func (u *user) handleUpstreamDisconnected(uc *upstreamConn) { uc.forEachDownstream(func(dc *downstreamConn) { dc.updateSupportedCaps() }) + + // If the network has been removed, don't send a state change notification + found := false + for _, net := range u.networks { + if net == uc.network { + found = true + break + } + } + if !found { + return + } + u.forEachDownstream(func(dc *downstreamConn) { if dc.caps["soju.im/bouncer-networks-notify"] { dc.SendMessage(&irc.Message{