From dab91736db5a40f4ecd9a2b18a67aa9ea448db12 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 16 Mar 2021 09:41:07 +0100 Subject: [PATCH] Send NOTICE to downstream when upstream is disconnected Closes: https://todo.sr.ht/~emersion/soju/76 --- user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user.go b/user.go index 031db9c..73a9058 100644 --- a/user.go +++ b/user.go @@ -428,6 +428,12 @@ func (u *user) run() { u.downstreamConns = append(u.downstreamConns, dc) + dc.forEachNetwork(func(network *network) { + if network.lastError != nil { + sendServiceNOTICE(dc, fmt.Sprintf("disconnected from %s: %v", network.GetName(), network.lastError)) + } + }) + u.forEachUpstream(func(uc *upstreamConn) { uc.updateAway() })