From 0fe853b1ee644703e2273ed4ce331cfd377af268 Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Sat, 29 May 2021 19:36:54 +0200 Subject: first implementation of search feature --- internal/util/statustools.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/util/statustools.go') diff --git a/internal/util/statustools.go b/internal/util/statustools.go index 2c74749e5..8f9cb795c 100644 --- a/internal/util/statustools.go +++ b/internal/util/statustools.go @@ -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) -- cgit v1.2.3