about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-19 18:49:15 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:43:08 -0500
commit8c8ad0ac0ed0d3e67f3e521068b59edd4054f1e9 (patch)
treed7a048c5c8235104d0aac69376613b203bc74295
parent642793e412573b19fd559a82576aa7e2f637998f (diff)
[Feature] Use permitted-for scope for public pages
-rw-r--r--app/controllers/accounts_controller.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index 81b8f8985..651da89ad 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -17,7 +17,7 @@ class AccountsController < ApplicationController
     respond_to do |format|
       format.html do
         use_pack 'public'
-        expires_in 0, public: true unless user_signed_in?
+        expires_in 0, public: true unless user_signed_in? || signed_request_account.present?
 
         @pinned_statuses   = []
         @endorsed_accounts = @account.endorsed_accounts.to_a.sample(4)
@@ -40,7 +40,7 @@ class AccountsController < ApplicationController
       end
 
       format.rss do
-        expires_in 1.minute, public: true
+        expires_in 1.minute, public: !(user_signed_in? || signed_request_account.present?)
 
         limit     = params[:limit].present? ? [params[:limit].to_i, PAGE_SIZE_MAX].min : PAGE_SIZE
         @statuses = filtered_statuses.without_reblogs.limit(limit)
@@ -74,8 +74,7 @@ class AccountsController < ApplicationController
   end
 
   def default_statuses
-    visibility_scopes = user_signed_in? || @account.show_unlisted? ? [:public, :unlisted] : :public
-    @account.statuses.not_local_only.where(visibility: visibility_scopes)
+    @account.statuses.permitted_for(@account, current_account, user_signed_in: user_signed_in?).not_local_only
   end
 
   def only_media_scope