From a872ddebe67c7b76cbb78667224b393a847834ac Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 6 Sep 2022 12:42:55 +0200 Subject: [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 --- internal/api/client/admin/emojicreate_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'internal/api/client/admin/emojicreate_test.go') diff --git a/internal/api/client/admin/emojicreate_test.go b/internal/api/client/admin/emojicreate_test.go index ebef858aa..3131e0816 100644 --- a/internal/api/client/admin/emojicreate_test.go +++ b/internal/api/client/admin/emojicreate_test.go @@ -29,8 +29,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/superseriousbusiness/gotosocial/internal/api/client/admin" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" - "github.com/superseriousbusiness/gotosocial/internal/db" - "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/testrig" ) @@ -79,8 +77,7 @@ func (suite *EmojiCreateTestSuite) TestEmojiCreate() { suite.True(apiEmoji.VisibleInPicker) // emoji should be in the db - dbEmoji := >smodel.Emoji{} - err = suite.db.GetWhere(context.Background(), []db.Where{{Key: "shortcode", Value: "new_emoji"}}, dbEmoji) + dbEmoji, err := suite.db.GetEmojiByShortcodeDomain(context.Background(), apiEmoji.Shortcode, "") suite.NoError(err) // check fields on the emoji -- cgit v1.2.3