Rename upstreamConn.caps to supportedCaps

For consistency with downstreamConn.
This commit is contained in:
Simon Ser 2020-04-29 19:40:31 +02:00
parent 0c549d68c4
commit 8445979956
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -46,7 +46,7 @@ type upstreamConn struct {
realname string realname string
modes userModes modes userModes
channels map[string]*upstreamChannel channels map[string]*upstreamChannel
caps map[string]string // available capabilities supportedCaps map[string]string
batches map[string]batch batches map[string]batch
away bool away bool
@ -110,7 +110,7 @@ func connectToUpstream(network *network) (*upstreamConn, error) {
network: network, network: network,
user: network.user, user: network.user,
channels: make(map[string]*upstreamChannel), channels: make(map[string]*upstreamChannel),
caps: make(map[string]string), supportedCaps: make(map[string]string),
batches: make(map[string]batch), batches: make(map[string]batch),
availableChannelTypes: stdChannelTypes, availableChannelTypes: stdChannelTypes,
availableChannelModes: stdChannelModes, availableChannelModes: stdChannelModes,
@ -310,7 +310,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
if len(kv) == 2 { if len(kv) == 2 {
v = kv[1] v = kv[1]
} }
uc.caps[k] = v uc.supportedCaps[k] = v
} }
if more { if more {
@ -319,7 +319,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
requestCaps := make([]string, 0, 16) requestCaps := make([]string, 0, 16)
for _, c := range []string{"message-tags", "batch", "labeled-response", "server-time", "away-notify"} { for _, c := range []string{"message-tags", "batch", "labeled-response", "server-time", "away-notify"} {
if _, ok := uc.caps[c]; ok { if _, ok := uc.supportedCaps[c]; ok {
requestCaps = append(requestCaps, c) requestCaps = append(requestCaps, c)
} }
} }
@ -1260,7 +1260,7 @@ func (uc *upstreamConn) requestSASL() bool {
return false return false
} }
v, ok := uc.caps["sasl"] v, ok := uc.supportedCaps["sasl"]
if !ok { if !ok {
return false return false
} }