First implementation of search functionality for remote account and status lookups.
This commit is contained in:
Tobi Smethurst 2021-05-29 19:39:43 +02:00 committed by GitHub
commit 1fe5e36ac3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 769 additions and 26 deletions

View file

@ -77,6 +77,11 @@ func ExtractMentionParts(mention string) (username, domain string, err error) {
return
}
// IsMention returns true if the passed string looks like @whatever@example.org
func IsMention(mention string) bool {
return mentionNameRegex.MatchString(strings.ToLower(mention))
}
// unique returns a deduplicated version of a given string slice.
func unique(s []string) []string {
keys := make(map[string]bool)