Send channel info to downstream on registration

This commit is contained in:
Simon Ser 2020-02-06 22:29:24 +01:00
parent 3b0639bacc
commit ec658e3d39
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

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