summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/attachment.go19
-rw-r--r--internal/api/model/status.go4
2 files changed, 19 insertions, 4 deletions
diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go
index 7e81759f2..d0b0c81e5 100644
--- a/internal/api/model/attachment.go
+++ b/internal/api/model/attachment.go
@@ -90,12 +90,23 @@ type Attachment struct {
// 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"`
+}
+
+// WebAttachment is like Attachment, but with
+// additional fields not exposed via JSON;
+// used only internally for templating etc.
+//
+// swagger:ignore
+type WebAttachment struct {
+ *Attachment
- // Additional fields not exposed via JSON
- // (used only internally for templating etc).
+ // Parent status of this
+ // media is sensitive.
+ Sensitive bool
- // Parent status of this media is sensitive.
- Sensitive bool `json:"-"`
+ // MIME type of
+ // the attachment.
+ MIMEType string
}
// MediaMeta models media metadata.
diff --git a/internal/api/model/status.go b/internal/api/model/status.go
index a9c668565..e469835bd 100644
--- a/internal/api/model/status.go
+++ b/internal/api/model/status.go
@@ -111,6 +111,10 @@ type Status struct {
type WebStatus struct {
*Status
+ // Web version of media
+ // attached to this status.
+ MediaAttachments []*WebAttachment `json:"media_attachments"`
+
// Template-ready language tag and
// string, based on *status.Language.
LanguageTag *language.Language