mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-29 07:29:31 +01:00
commit
b9a1cd618e
@ -4,6 +4,7 @@
|
|||||||
package sno
|
package sno
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -34,6 +35,10 @@ func (masks Masks) Contains(mask Mask) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (masks Masks) Sort() {
|
||||||
|
sort.Slice(masks, func(i, j int) bool { return masks[i] < masks[j] })
|
||||||
|
}
|
||||||
|
|
||||||
// Evaluate changes to snomasks made with MODE. There are several cases:
|
// Evaluate changes to snomasks made with MODE. There are several cases:
|
||||||
// adding snomasks with `/mode +s a` or `/mode +s +a`, removing them with `/mode +s -a`,
|
// adding snomasks with `/mode +s a` or `/mode +s +a`, removing them with `/mode +s -a`,
|
||||||
// adding all with `/mode +s *` or `/mode +s +*`, removing all with `/mode +s -*` or `/mode -s`
|
// adding all with `/mode +s *` or `/mode +s +*`, removing all with `/mode +s -*` or `/mode -s`
|
||||||
|
@ -109,6 +109,7 @@ func (m *SnoManager) MasksEnabled(client *Client) (result sno.Masks) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
result.Sort()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
irctest
2
irctest
@ -1 +1 @@
|
|||||||
Subproject commit 7be29ad801675380b6ec37c49d87bc688f3695a0
|
Subproject commit a7d74369297e4c2d19ede914b5524d0dafb27173
|
Loading…
Reference in New Issue
Block a user