Fix assignee filter bug in List
This commit is contained in:
17
service/mentions.go
Normal file
17
service/mentions.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"maps"
|
||||
"regexp"
|
||||
"slices"
|
||||
)
|
||||
|
||||
var mentionRegex = regexp.MustCompile(`@([a-z0-9_]+)`)
|
||||
|
||||
func mentions(t string) []string {
|
||||
seen := make(map[string]bool)
|
||||
for _, m := range mentionRegex.FindAllStringSubmatch(t, -1) {
|
||||
seen[m[1]] = true
|
||||
}
|
||||
return slices.Collect(maps.Keys(seen))
|
||||
}
|
||||
Reference in New Issue
Block a user