mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #1669
Sort snomasks for display rather than displaying them in hash order
This commit is contained in:
parent
75208d2934
commit
33e3b0ce1b
2 changed files with 6 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
package sno
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
@ -34,6 +35,10 @@ func (masks Masks) Contains(mask Mask) bool {
|
|||
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:
|
||||
// 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`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue