~emersion/soju

79b0fe5de592a66249ac8e47c03979a6f0e923de — Simon Ser 11 days ago a4a9b7e
Don't send network notification when removed

Closes: https://todo.sr.ht/~emersion/soju/123
1 files changed, 13 insertions(+), 0 deletions(-)

M user.go
M user.go => user.go +13 -0
@@ 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{