diff options
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/client/followrequests/get_test.go | 4 | ||||
-rw-r--r-- | internal/api/client/media/mediacreate_test.go | 8 | ||||
-rw-r--r-- | internal/api/client/media/mediaupdate_test.go | 4 | ||||
-rw-r--r-- | internal/api/model/attachment.go | 8 |
4 files changed, 12 insertions, 12 deletions
diff --git a/internal/api/client/followrequests/get_test.go b/internal/api/client/followrequests/get_test.go index f2fa832a1..24f3c9646 100644 --- a/internal/api/client/followrequests/get_test.go +++ b/internal/api/client/followrequests/get_test.go @@ -99,8 +99,8 @@ func (suite *GetTestSuite) TestGet() { "header_static": "http://localhost:8080/assets/default_header.png", "followers_count": 0, "following_count": 0, - "statuses_count": 0, - "last_status_at": null, + "statuses_count": 1, + "last_status_at": "2023-11-02T10:44:25.000Z", "emojis": [], "fields": [] } diff --git a/internal/api/client/media/mediacreate_test.go b/internal/api/client/media/mediacreate_test.go index 3f0b9dc0d..928d70379 100644 --- a/internal/api/client/media/mediacreate_test.go +++ b/internal/api/client/media/mediacreate_test.go @@ -216,8 +216,8 @@ func (suite *MediaCreateTestSuite) TestMediaCreateSuccessful() { X: -0.5, Y: 0.5, }, - }, attachmentReply.Meta) - suite.Equal("LiBzRk#6V[WF_NvzV@WY_3rqV@a$", attachmentReply.Blurhash) + }, *attachmentReply.Meta) + suite.Equal("LiBzRk#6V[WF_NvzV@WY_3rqV@a$", *attachmentReply.Blurhash) suite.NotEmpty(attachmentReply.ID) suite.NotEmpty(attachmentReply.URL) suite.NotEmpty(attachmentReply.PreviewURL) @@ -301,8 +301,8 @@ func (suite *MediaCreateTestSuite) TestMediaCreateSuccessfulV2() { X: -0.5, Y: 0.5, }, - }, attachmentReply.Meta) - suite.Equal("LiBzRk#6V[WF_NvzV@WY_3rqV@a$", attachmentReply.Blurhash) + }, *attachmentReply.Meta) + suite.Equal("LiBzRk#6V[WF_NvzV@WY_3rqV@a$", *attachmentReply.Blurhash) suite.NotEmpty(attachmentReply.ID) suite.Nil(attachmentReply.URL) suite.NotEmpty(attachmentReply.PreviewURL) diff --git a/internal/api/client/media/mediaupdate_test.go b/internal/api/client/media/mediaupdate_test.go index 603bde402..a0ff1b96d 100644 --- a/internal/api/client/media/mediaupdate_test.go +++ b/internal/api/client/media/mediaupdate_test.go @@ -186,8 +186,8 @@ func (suite *MediaUpdateTestSuite) TestUpdateImage() { Original: apimodel.MediaDimensions{Width: 800, Height: 450, FrameRate: "", Duration: 0, Bitrate: 0, Size: "800x450", Aspect: 1.7777778}, Small: apimodel.MediaDimensions{Width: 256, Height: 144, FrameRate: "", Duration: 0, Bitrate: 0, Size: "256x144", Aspect: 1.7777778}, Focus: &apimodel.MediaFocus{X: -0.1, Y: 0.3}, - }, attachmentReply.Meta) - suite.Equal(toUpdate.Blurhash, attachmentReply.Blurhash) + }, *attachmentReply.Meta) + suite.Equal(toUpdate.Blurhash, *attachmentReply.Blurhash) suite.Equal(toUpdate.ID, attachmentReply.ID) suite.Equal(toUpdate.URL, *attachmentReply.URL) suite.NotEmpty(toUpdate.Thumbnail.URL, attachmentReply.PreviewURL) diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go index f9f1c95e9..1911fc9c3 100644 --- a/internal/api/model/attachment.go +++ b/internal/api/model/attachment.go @@ -70,10 +70,10 @@ type Attachment struct { URL *string `json:"url"` // A shorter URL for the attachment. // In our case, we just give the URL again since we don't create smaller URLs. - TextURL string `json:"text_url"` + TextURL *string `json:"text_url"` // The location of a scaled-down preview of the attachment. // example: https://example.org/fileserver/some_id/attachments/some_id/small/attachment.jpeg - PreviewURL string `json:"preview_url"` + PreviewURL *string `json:"preview_url"` // The location of the full-size original attachment on the remote server. // Only defined for instances other than our own. // example: https://some-other-server.org/attachments/original/ahhhhh.jpeg @@ -83,13 +83,13 @@ type Attachment struct { // example: https://some-other-server.org/attachments/small/ahhhhh.jpeg PreviewRemoteURL *string `json:"preview_remote_url"` // Metadata for this attachment. - Meta MediaMeta `json:"meta,omitempty"` + Meta *MediaMeta `json:"meta"` // Alt text that describes what is in the media attachment. // example: This is a picture of a kitten. Description *string `json:"description"` // A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet. // See https://github.com/woltapp/blurhash - Blurhash string `json:"blurhash,omitempty"` + Blurhash *string `json:"blurhash"` } // MediaMeta models media metadata. |