diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/status.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 62f8d2778..68093eb73 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -524,7 +524,6 @@ class Status < ApplicationRecord visibility = :public if options[:public] || (account.blank? && !target_account.show_unlisted?) scope = where(visibility: visibility) - scope = apply_account_filters(scope, account, **options) apply_category_filters(scope, target_account, account, **options) end @@ -554,6 +553,8 @@ class Status < ApplicationRecord # TODO: Cast cleanup spell. # rubocop:disable Metrics/PerceivedComplexity def apply_category_filters(query, target_account, account, **options) + options[:without_account_filters] ||= target_account.id == account&.id + query = apply_account_filters(query, account, **options) return query if options[:without_category_filters] query = query.published unless options[:include_unpublished] @@ -602,9 +603,9 @@ class Status < ApplicationRecord def apply_account_filters(query, account, **options) return query.not_local_only if account.blank? - return (account.local? ? query : query.not_local_only) if options[:without_account_filters] + return (!options[:exclude_local_only] && account.local? ? query : query.not_local_only) if options[:without_account_filters] - query = query.not_local_only unless account.local? + query = query.not_local_only unless !options[:exclude_local_only] && account.local? query = query.not_hidden_by_account(account) query = query.in_chosen_languages(account) if account.chosen_languages.present? query |