summaryrefslogtreecommitdiff
path: root/internal/util/statustools.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-29 19:39:43 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-29 19:39:43 +0200
commit1fe5e36ac3a631a53724fe99583b7f11baa32c53 (patch)
tree40ae75c3613c9c6915273f98fe7ce41046d11381 /internal/util/statustools.go
parentfederate account updates (diff)
downloadgotosocial-1fe5e36ac3a631a53724fe99583b7f11baa32c53.tar.xz
Search (#36)
First implementation of search functionality for remote account and status lookups.
Diffstat (limited to 'internal/util/statustools.go')
-rw-r--r--internal/util/statustools.go5
1 files changed, 5 insertions, 0 deletions
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)