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

git-svn-id: file:///srv/svn/repo/suika/trunk@469 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
contact 2021-03-16 17:25:21 +00:00
parent edca8b005f
commit df382ec139

View File

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