mirror of
https://github.com/fluffle/goirc
synced 2025-06-07 15:23:20 +00:00
Handle capability invalidation
This commit is contained in:
parent
7e2b14df1f
commit
70cdb2ed2b
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue