Rename upstreamConn.caps to supportedCaps
For consistency with downstreamConn.
This commit is contained in:
parent
0c549d68c4
commit
8445979956
10
upstream.go
10
upstream.go
@ -46,7 +46,7 @@ type upstreamConn struct {
|
||||
realname string
|
||||
modes userModes
|
||||
channels map[string]*upstreamChannel
|
||||
caps map[string]string // available capabilities
|
||||
supportedCaps map[string]string
|
||||
batches map[string]batch
|
||||
away bool
|
||||
|
||||
@ -110,7 +110,7 @@ func connectToUpstream(network *network) (*upstreamConn, error) {
|
||||
network: network,
|
||||
user: network.user,
|
||||
channels: make(map[string]*upstreamChannel),
|
||||
caps: make(map[string]string),
|
||||
supportedCaps: make(map[string]string),
|
||||
batches: make(map[string]batch),
|
||||
availableChannelTypes: stdChannelTypes,
|
||||
availableChannelModes: stdChannelModes,
|
||||
@ -310,7 +310,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
if len(kv) == 2 {
|
||||
v = kv[1]
|
||||
}
|
||||
uc.caps[k] = v
|
||||
uc.supportedCaps[k] = v
|
||||
}
|
||||
|
||||
if more {
|
||||
@ -319,7 +319,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
||||
|
||||
requestCaps := make([]string, 0, 16)
|
||||
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)
|
||||
}
|
||||
}
|
||||
@ -1260,7 +1260,7 @@ func (uc *upstreamConn) requestSASL() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
v, ok := uc.caps["sasl"]
|
||||
v, ok := uc.supportedCaps["sasl"]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user