From f7323c065a086533ce8c7f0f0cb3f69a80539992 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:03:05 +0200 Subject: [feature] Update attachment format, receive + send `focalPoint` prop + use it on the frontend (#4052) * [feature] Update attachment format, receive + send `focalPoint` prop + use it on the frontend * whoops * boop * restore function signature of ExtractAttachments --- internal/typeutils/internaltoas_test.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'internal/typeutils/internaltoas_test.go') diff --git a/internal/typeutils/internaltoas_test.go b/internal/typeutils/internaltoas_test.go index 7c05a14b8..37bfa31f3 100644 --- a/internal/typeutils/internaltoas_test.go +++ b/internal/typeutils/internaltoas_test.go @@ -597,6 +597,10 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASWithIDs() { "Emoji": "toot:Emoji", "Hashtag": "as:Hashtag", "blurhash": "toot:blurhash", + "focalPoint": { + "@container": "@list", + "@id": "toot:focalPoint" + }, "sensitive": "as:sensitive", "toot": "http://joinmastodon.org/ns#" } @@ -604,9 +608,13 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASWithIDs() { "attachment": [ { "blurhash": "LIIE|gRj00WB-;j[t7j[4nWBj[Rj", + "focalPoint": [ + -0.5, + 0.5 + ], "mediaType": "image/jpeg", - "name": "Black and white image of some 50's style text saying: Welcome On Board", - "type": "Document", + "summary": "Black and white image of some 50's style text saying: Welcome On Board", + "type": "Image", "url": "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpg" } ], @@ -697,6 +705,10 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASFromDB() { "Emoji": "toot:Emoji", "Hashtag": "as:Hashtag", "blurhash": "toot:blurhash", + "focalPoint": { + "@container": "@list", + "@id": "toot:focalPoint" + }, "sensitive": "as:sensitive", "toot": "http://joinmastodon.org/ns#" } @@ -704,9 +716,13 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASFromDB() { "attachment": [ { "blurhash": "LIIE|gRj00WB-;j[t7j[4nWBj[Rj", + "focalPoint": [ + -0.5, + 0.5 + ], "mediaType": "image/jpeg", - "name": "Black and white image of some 50's style text saying: Welcome On Board", - "type": "Document", + "summary": "Black and white image of some 50's style text saying: Welcome On Board", + "type": "Image", "url": "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpg" } ], -- cgit v1.2.3