diff options
| author | 2022-09-06 12:42:55 +0200 | |
|---|---|---|
| committer | 2022-09-06 12:42:55 +0200 | |
| commit | a872ddebe67c7b76cbb78667224b393a847834ac (patch) | |
| tree | 28b7d0081ee12ab9928eff0aecd6b55d32d8228d /internal/db/emoji.go | |
| parent | [bugfix] Catch json syntax errors in the frontend + display a more helpful me... (diff) | |
| download | gotosocial-a872ddebe67c7b76cbb78667224b393a847834ac.tar.xz | |
[feature] Custom emoji updates (serve emoji via s2s api, tune db models) (#805)
* migrate emojis
* add get emoji to s2s (federation) API
* add new emoji db + cache functions
* add shortcodeDomain lookup for emojis
* check existing emojis w/cache, not w/constraints
* go fmt
* add putEmoji func
* use new db emoji funcs instead of where
* remove emojistringstotags func
* add unique constraint back in
* fix up broken migration
* update index
Diffstat (limited to 'internal/db/emoji.go')
| -rw-r--r-- | internal/db/emoji.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/db/emoji.go b/internal/db/emoji.go index f2694b460..0038e10e4 100644 --- a/internal/db/emoji.go +++ b/internal/db/emoji.go @@ -26,6 +26,13 @@ import ( // Emoji contains functions for getting emoji in the database. type Emoji interface { + // PutEmoji puts one emoji in the database. + PutEmoji(ctx context.Context, emoji *gtsmodel.Emoji) Error // GetCustomEmojis gets all custom emoji for the instance GetCustomEmojis(ctx context.Context) ([]*gtsmodel.Emoji, Error) + // GetEmojiByID gets a specific emoji by its database ID. + GetEmojiByID(ctx context.Context, id string) (*gtsmodel.Emoji, Error) + // GetEmojiByShortcodeDomain gets an emoji based on its shortcode and domain. + // For local emoji, domain should be an empty string. + GetEmojiByShortcodeDomain(ctx context.Context, shortcode string, domain string) (*gtsmodel.Emoji, Error) } |
