From ec658e3d39fc176b8bea01aca45ea46ccf77c076 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 6 Feb 2020 22:29:24 +0100 Subject: [PATCH] Send channel info to downstream on registration --- downstream.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/downstream.go b/downstream.go index af60729..b27b09f 100644 --- a/downstream.go +++ b/downstream.go @@ -197,6 +197,20 @@ func (c *downstreamConn) register() error { Params: []string{c.nick, "No MOTD"}, }) + c.srv.lock.Lock() + for _, uc := range c.srv.upstreamConns { + // TODO: fix races accessing upstream connection data + if !uc.registered { + continue + } + for _, ch := range uc.channels { + if ch.complete { + forwardChannel(c, ch) + } + } + } + c.srv.lock.Unlock() + return nil }