diff options
author | Starfall <us@starfall.systems> | 2022-01-31 12:50:14 -0600 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2022-01-31 12:50:14 -0600 |
commit | 17265f47f8f931e70699088dd8bd2a1c7b78112b (patch) | |
tree | a1dde2630cd8e481cc4c5d047c4af241a251def0 /app/controllers/accounts_controller.rb | |
parent | 129962006c2ebcd195561ac556887dc87d32081c (diff) | |
parent | d6f3261c6cb810ea4eb6f74b9ee62af0d94cbd52 (diff) |
Merge branch 'glitchsoc'
Diffstat (limited to 'app/controllers/accounts_controller.rb')
-rw-r--r-- | app/controllers/accounts_controller.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index f9bd616e4..03c07c50b 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -29,7 +29,7 @@ class AccountsController < ApplicationController return end - @pinned_statuses = cache_collection(@account.pinned_statuses.not_local_only, Status) if show_pinned_statuses? + @pinned_statuses = cached_filtered_status_pins if show_pinned_statuses? @statuses = cached_filtered_status_page @rss_url = rss_url @@ -65,6 +65,10 @@ class AccountsController < ApplicationController [replies_requested?, media_requested?, tag_requested?, params[:max_id].present?, params[:min_id].present?].none? end + def filtered_pinned_statuses + @account.pinned_statuses.not_local_only.where(visibility: [:public, :unlisted]) + end + def filtered_statuses default_statuses.tap do |statuses| statuses.merge!(hashtag_scope) if tag_requested? @@ -143,6 +147,13 @@ class AccountsController < ApplicationController request.path.split('.').first.end_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize) end + def cached_filtered_status_pins + cache_collection( + filtered_pinned_statuses, + Status + ) + end + def cached_filtered_status_page cache_collection_paginated_by_id( filtered_statuses, |