Changeset 437 in code for trunk


Ignore:
Timestamp:
Dec 25, 2020, 12:35:20 PM (4 years ago)
Author:
hubert
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r435 r437  
    554554                        if dc.capVersion, err = strconv.Atoi(args[0]); err != nil {
    555555                                return err
     556                        }
     557                }
     558                if !dc.registered && dc.capVersion >= 302 {
     559                        // Let downstream show everything it supports, and trim
     560                        // down the available capabilities when upstreams are
     561                        // known.
     562                        for k, v := range needAllDownstreamCaps {
     563                                dc.supportedCaps[k] = v
    556564                        }
    557565                }
     
    897905
    898906        dc.updateNick()
     907        dc.updateSupportedCaps()
    899908
    900909        dc.forEachUpstream(func(uc *upstreamConn) {
  • trunk/user.go

    r435 r437  
    436436                                uc.updateAway()
    437437                        })
    438 
    439                         dc.updateSupportedCaps()
    440438                case eventDownstreamDisconnected:
    441439                        dc := e.dc
Note: See TracChangeset for help on using the changeset viewer.