Advertise all caps, CAP DEL them on registration
... so that the JOIN/history batch takes into account all capabilities. Without this commit for example, enabling multi-prefix after the batch makes the client send NAMES requests for all channels, which generate needless traffic.
This commit is contained in:
parent
0ddc0de7e5
commit
7bfa4dafef
@ -555,6 +555,14 @@ func (dc *downstreamConn) handleCapCommand(cmd string, args []string) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !dc.registered && dc.capVersion >= 302 {
|
||||
// Let downstream show everything it supports, and trim
|
||||
// down the available capabilities when upstreams are
|
||||
// known.
|
||||
for k, v := range needAllDownstreamCaps {
|
||||
dc.supportedCaps[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
caps := make([]string, 0, len(dc.supportedCaps))
|
||||
for k, v := range dc.supportedCaps {
|
||||
@ -896,6 +904,7 @@ func (dc *downstreamConn) welcome() error {
|
||||
})
|
||||
|
||||
dc.updateNick()
|
||||
dc.updateSupportedCaps()
|
||||
|
||||
dc.forEachUpstream(func(uc *upstreamConn) {
|
||||
for _, ch := range uc.channels {
|
||||
|
Loading…
Reference in New Issue
Block a user