summaryrefslogtreecommitdiff
path: root/internal/api/model/attachment.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-05-28 19:59:55 +0200
committerLibravatar GitHub <noreply@github.com>2022-05-28 18:59:55 +0100
commitae5402ada6aa794a69de455f745934b27e030d3d (patch)
tree93d228443da821b0b38cc1417742e65e92e5edec /internal/api/model/attachment.go
parent[frontend] Reduce width of profile img with screen width (#615) (diff)
downloadgotosocial-ae5402ada6aa794a69de455f745934b27e030d3d.tar.xz
[chore] Mastodon api fixups (#617)
* don't omitempty on description * don't omitempty on any fields * add ms to timestamp format * don't omitempty on text_url * rearrange attachment fields a bit * just give URL again as attachment text url * update tests * fix accidental replace
Diffstat (limited to 'internal/api/model/attachment.go')
-rw-r--r--internal/api/model/attachment.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go
index 061d7918e..3ab29d2fb 100644
--- a/internal/api/model/attachment.go
+++ b/internal/api/model/attachment.go
@@ -69,25 +69,25 @@ type Attachment struct {
// The location of the original full-size attachment.
// example: https://example.org/fileserver/some_id/attachments/some_id/original/attachment.jpeg
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"`
// 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"`
// 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
- RemoteURL string `json:"remote_url,omitempty"`
+ RemoteURL string `json:"remote_url"`
// The location of a scaled-down preview of the attachment on the remote server.
// Only defined for instances other than our own.
// example: https://some-other-server.org/attachments/small/ahhhhh.jpeg
- PreviewRemoteURL string `json:"preview_remote_url,omitempty"`
- // A shorter URL for the attachment.
- // Not currently used.
- TextURL string `json:"text_url,omitempty"`
+ PreviewRemoteURL string `json:"preview_remote_url"`
// Metadata for this attachment.
Meta MediaMeta `json:"meta,omitempty"`
// Alt text that describes what is in the media attachment.
// example: This is a picture of a kitten.
- Description string `json:"description,omitempty"`
+ 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"`