mirror of https://github.com/fluffle/goirc
Handle capability invalidation
This commit is contained in:
parent
7e2b14df1f
commit
70cdb2ed2b
|
@ -110,8 +110,12 @@ func capabilitySet() *capSet {
|
||||||
func (c *capSet) Add(caps ...string) {
|
func (c *capSet) Add(caps ...string) {
|
||||||
c.mu.Lock()
|
c.mu.Lock()
|
||||||
for _, cap := range caps {
|
for _, cap := range caps {
|
||||||
|
if strings.HasPrefix(cap, "-") {
|
||||||
|
c.caps[cap[1:]] = false
|
||||||
|
} else {
|
||||||
c.caps[cap] = true
|
c.caps[cap] = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
c.mu.Unlock()
|
c.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue