Send NOTICE to downstream when upstream is disconnected

Closes: https://todo.sr.ht/~emersion/soju/76
This commit is contained in:
Simon Ser 2021-03-16 09:41:07 +01:00
parent 061347f9f9
commit dab91736db

View File

@ -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()
})