From 5543fd53400037dc8ae22d4919b7085c46177ce1 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:07:25 +0200 Subject: [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 --- internal/gtsmodel/accountsettings.go | 5 ++++- internal/gtsmodel/status.go | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/gtsmodel') diff --git a/internal/gtsmodel/accountsettings.go b/internal/gtsmodel/accountsettings.go index 592a2330d..3151ba5b7 100644 --- a/internal/gtsmodel/accountsettings.go +++ b/internal/gtsmodel/accountsettings.go @@ -17,7 +17,9 @@ package gtsmodel -import "time" +import ( + "time" +) // AccountSettings models settings / preferences for a local, non-instance account. type AccountSettings struct { @@ -32,6 +34,7 @@ type AccountSettings struct { CustomCSS string `bun:",nullzero"` // Custom CSS that should be displayed for this Account's profile and statuses. EnableRSS *bool `bun:",nullzero,notnull,default:false"` // enable RSS feed subscription for this account's public posts at [URL]/feed HideCollections *bool `bun:",nullzero,notnull,default:false"` // Hide this account's followers/following collections. + WebVisibility Visibility `bun:",nullzero,notnull,default:public"` // Visibility level of statuses that visitors can view via the web profile. InteractionPolicyDirect *InteractionPolicy `bun:""` // Interaction policy to use for new direct visibility statuses by this account. If null, assume default policy. InteractionPolicyMutualsOnly *InteractionPolicy `bun:""` // Interaction policy to use for new mutuals only visibility statuses. If null, assume default policy. InteractionPolicyFollowersOnly *InteractionPolicy `bun:""` // Interaction policy to use for new followers only visibility statuses. If null, assume default policy. diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go index 70fd9c367..9ebbc18c7 100644 --- a/internal/gtsmodel/status.go +++ b/internal/gtsmodel/status.go @@ -238,6 +238,9 @@ type StatusToEmoji struct { type Visibility string const ( + // VisibilityNone means nobody can see this. + // It's only used for web status visibility. + VisibilityNone Visibility = "none" // VisibilityPublic means this status will be visible to everyone on all timelines. VisibilityPublic Visibility = "public" // VisibilityUnlocked means this status will be visible to everyone, but will only show on home timeline to followers, and in lists. -- cgit v1.3