Changeset 292 in code for trunk/downstream.go
- Timestamp:
- May 11, 2020, 10:25:49 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r291 r292 60 60 "sasl": "PLAIN", 61 61 "server-time": "", 62 } 63 64 // needAllDownstreamCaps is the list of downstream capabilities that 65 // require support from all upstreams to be enabled 66 var needAllDownstreamCaps = map[string]string{ 67 "away-notify": "", 68 "multi-prefix": "", 62 69 } 63 70 … … 597 604 598 605 func (dc *downstreamConn) updateSupportedCaps() { 599 awayNotifySupported := true 606 supportedCaps := make(map[string]bool) 607 for cap := range needAllDownstreamCaps { 608 supportedCaps[cap] = true 609 } 600 610 dc.forEachUpstream(func(uc *upstreamConn) { 601 awayNotifySupported = awayNotifySupported && uc.caps["away-notify"] 611 for cap, supported := range supportedCaps { 612 supportedCaps[cap] = supported && uc.caps[cap] 613 } 602 614 }) 603 615 604 if awayNotifySupported { 605 dc.setSupportedCap("away-notify", "") 606 } else { 607 dc.unsetSupportedCap("away-notify") 616 for cap, supported := range supportedCaps { 617 if supported { 618 dc.setSupportedCap(cap, needAllDownstreamCaps[cap]) 619 } else { 620 dc.unsetSupportedCap(cap) 621 } 608 622 } 609 623 }
Note:
See TracChangeset
for help on using the changeset viewer.