mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 00:18:07 -06:00
[feature/frontend] Add options to include Unlisted posts or hide all posts (#3272)
* [feature/frontend] Add options to include Unlisted posts or hide all posts * finish up * swagger * move invalidate call into bundb package, avoid invalidating if not necessary * rename show_web_statuses => web_visibility * don't use ptr for webvisibility * last bits
This commit is contained in:
parent
7785fa54da
commit
5543fd5340
24 changed files with 523 additions and 161 deletions
|
|
@ -38,6 +38,8 @@ func APIVisToVis(m apimodel.Visibility) gtsmodel.Visibility {
|
|||
return gtsmodel.VisibilityMutualsOnly
|
||||
case apimodel.VisibilityDirect:
|
||||
return gtsmodel.VisibilityDirect
|
||||
case apimodel.VisibilityNone:
|
||||
return gtsmodel.VisibilityNone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,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),
|
||||
Sensitive: *a.Settings.Sensitive,
|
||||
Language: a.Settings.Language,
|
||||
StatusContentType: statusContentType,
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ func (suite *InternalToFrontendTestSuite) TestAccountToFrontendAliasedAndMoved()
|
|||
"fields": [],
|
||||
"source": {
|
||||
"privacy": "public",
|
||||
"web_visibility": "unlisted",
|
||||
"sensitive": false,
|
||||
"language": "en",
|
||||
"status_content_type": "text/plain",
|
||||
|
|
@ -304,6 +305,7 @@ func (suite *InternalToFrontendTestSuite) TestAccountToFrontendSensitive() {
|
|||
"fields": [],
|
||||
"source": {
|
||||
"privacy": "public",
|
||||
"web_visibility": "unlisted",
|
||||
"sensitive": false,
|
||||
"language": "en",
|
||||
"status_content_type": "text/plain",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue