diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account.rb | 2 | ||||
-rw-r--r-- | app/models/status.rb | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 48e6e8532..8b384f212 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -51,6 +51,8 @@ # header_storage_schema_version :integer # devices_url :string # require_dereference :boolean default(FALSE), not null +# show_replies :boolean default(TRUE), not null +# show_unlisted :boolean default(TRUE), not null # class Account < ApplicationRecord diff --git a/app/models/status.rb b/app/models/status.rb index bee7d1e67..54023c24c 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -390,8 +390,8 @@ class Status < ApplicationRecord end end - def permitted_for(target_account, account) - visibility = [:public, :unlisted] + def permitted_for(target_account, account, user_signed_in: false) + visibility = user_signed_in || target_account.show_unlisted? ? [:public, :unlisted] : :public if account.nil? where(visibility: visibility).not_local_only @@ -402,7 +402,7 @@ class Status < ApplicationRecord else # followers can see followers-only stuff, but also things they are mentioned in. # non-followers can see everything that isn't private/direct, but can see stuff they are mentioned in. - visibility.push(:private) if account.following?(target_account) + visibility.push(:private) if account.following?(target_account) && (user_signed_in || target_account.show_unlisted?) scope = left_outer_joins(:reblog) |