summaryrefslogtreecommitdiff
path: root/internal/gtsmodel
diff options
context:
space:
mode:
authorLibravatar Vyr Cossont <VyrCossont@users.noreply.github.com>2024-07-03 15:53:54 -0700
committerLibravatar GitHub <noreply@github.com>2024-07-03 15:53:54 -0700
commitfde0c6bc8cce2d86269faf33739281a533566455 (patch)
treeeede4b3eab1e9b36443c3a5afdbbc38cb106b751 /internal/gtsmodel
parent[docs] Update how to enable http2 on nginx (#3066) (diff)
downloadgotosocial-fde0c6bc8cce2d86269faf33739281a533566455.tar.xz
[chore] Allow gtsmodel to depend on util (#3068)
Convert one free function into a gtsmodel.Emoji method so that util does not depend on gtsmodel and can be used from it in the future
Diffstat (limited to 'internal/gtsmodel')
-rw-r--r--internal/gtsmodel/emoji.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/gtsmodel/emoji.go b/internal/gtsmodel/emoji.go
index c80e98ecb..7bf52586c 100644
--- a/internal/gtsmodel/emoji.go
+++ b/internal/gtsmodel/emoji.go
@@ -50,3 +50,8 @@ type Emoji struct {
func (e *Emoji) IsLocal() bool {
return e.Domain == ""
}
+
+// ShortcodeDomain returns the [shortcode]@[domain] for the given emoji.
+func (e *Emoji) ShortcodeDomain() string {
+ return e.Shortcode + "@" + e.Domain
+}