~emersion/soju-dev

Fix network.forEachDownstream exiting on first non-match v1 APPLIED

delthas: 1
 Fix network.forEachDownstream exiting on first non-match

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/soju-dev/patches/31529/mbox | git am -3
Learn more about email & git

[PATCH] Fix network.forEachDownstream exiting on first non-match Export this patch

This fixes a serious bug where we stop executing forEachDownstream on
the first downstream that does not match the network. Instead we want to
simply continue; it's a basic filter.
---
 user.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/user.go b/user.go
index 0810baa..9b7879f 100644
--- a/user.go
+++ b/user.go
@@ -158,10 +158,10 @@ func newNetwork(user *user, record *Network, channels []Channel) *network {
func (net *network) forEachDownstream(f func(*downstreamConn)) {
	for _, dc := range net.user.downstreamConns {
		if dc.network == nil && !dc.isMultiUpstream {
			return
			continue
		}
		if dc.network != nil && dc.network != net {
			return
			continue
		}
		f(dc)
	}

base-commit: 2a0cc57e3a771edc0da25671b48c1dfe6775f5ff
-- 
2.30.0
Pushed, thanks for the fix!