diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/api/model/attachment.go | 6 | ||||
-rw-r--r-- | internal/typeutils/internaltofrontend.go | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go index 1911fc9c3..7e81759f2 100644 --- a/internal/api/model/attachment.go +++ b/internal/api/model/attachment.go @@ -90,6 +90,12 @@ 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"` + + // Additional fields not exposed via JSON + // (used only internally for templating etc). + + // Parent status of this media is sensitive. + Sensitive bool `json:"-"` } // MediaMeta models media metadata. diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index fe5c8ec8f..b3d263963 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -721,6 +721,12 @@ func (c *Converter) StatusToWebStatus( webStatus.WebPollOptions = webPollOptions } + // Set additional templating + // variables on media attachments. + for _, a := range webStatus.MediaAttachments { + a.Sensitive = webStatus.Sensitive + } + return webStatus, nil } |