mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Allow user to choose "gallery" style layout for web view of profile (#3917)
* [feature] Allow user to choose "gallery" style web layout * find a bug and squish it up and all day long you'll have good luck * just a sec * [performance] reindex public timeline + tinker with query a bit * fiddling * should be good now * last bit of finagling, i'm done now i prommy * panic normally
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user