Don't update downstream caps in upstream RPL_WELCOME handler

Prior to being registered, upstreamConn.handleMessage doesn't run
in the user goroutine, it runs in a goroutine specific to the
network. Thus we shouldn't access any user data structure from
there.

downstreamConn.updateSupportedCaps is already called from the
eventUpstreamConnected handler in user.run, the call being removed
was unnecessary.

Closes: https://todo.sr.ht/~emersion/soju/108
This commit is contained in:
Simon Ser 2021-03-16 18:25:21 +01:00
parent 384075a6ed
commit e35a116188

View File

@ -590,10 +590,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
uc.registered = true uc.registered = true
uc.logger.Printf("connection registered") uc.logger.Printf("connection registered")
uc.forEachDownstream(func(dc *downstreamConn) {
dc.updateSupportedCaps()
})
if len(uc.network.channels) > 0 { if len(uc.network.channels) > 0 {
var channels, keys []string var channels, keys []string
for _, ch := range uc.network.channels { for _, ch := range uc.network.channels {