diff options
Diffstat (limited to 'internal/typeutils/internaltofrontend.go')
| -rw-r--r-- | internal/typeutils/internaltofrontend.go | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go index b0e137f75..b0f5d12fa 100644 --- a/internal/typeutils/internaltofrontend.go +++ b/internal/typeutils/internaltofrontend.go @@ -137,6 +137,7 @@ func (c *Converter) AccountToAPIAccountSensitive(ctx context.Context, a *gtsmode apiAccount.Source = &apimodel.Source{ Privacy: c.VisToAPIVis(ctx, a.Settings.Privacy), WebVisibility: c.VisToAPIVis(ctx, a.Settings.WebVisibility), + WebLayout: a.Settings.WebLayout.String(), Sensitive: *a.Settings.Sensitive, Language: a.Settings.Language, StatusContentType: statusContentType, @@ -222,6 +223,14 @@ func (c *Converter) AccountToWebAccount( } } + // Check for presence of settings before + // populating settings-specific thingies, + // as instance account doesn't store a + // settings struct. + if a.Settings != nil { + webAccount.WebLayout = a.Settings.WebLayout.String() + } + return webAccount, nil } @@ -1227,10 +1236,11 @@ func (c *Converter) StatusToWebStatus( for i, apiAttachment := range apiStatus.MediaAttachments { ogAttachment := ogAttachments[apiAttachment.ID] webStatus.MediaAttachments[i] = &apimodel.WebAttachment{ - Attachment: apiAttachment, - Sensitive: apiStatus.Sensitive, - MIMEType: ogAttachment.File.ContentType, - PreviewMIMEType: ogAttachment.Thumbnail.ContentType, + Attachment: apiAttachment, + Sensitive: apiStatus.Sensitive, + MIMEType: ogAttachment.File.ContentType, + PreviewMIMEType: ogAttachment.Thumbnail.ContentType, + ParentStatusLink: apiStatus.URL, } } |
