diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-11-10 05:34:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 05:34:42 +0100 |
commit | 0cd0786aef140ea41aa229cd52ac67867259a3f5 (patch) | |
tree | 9f93de02caf9e00f70051df18cdba625c8a43967 | |
parent | b280a255c4ee7117fa2b141a200b76975a727a7f (diff) |
Revert filtering public timelines by locale by default (#20294)
-rw-r--r-- | app/controllers/api/v1/timelines/public_controller.rb | 1 | ||||
-rw-r--r-- | app/models/public_feed.rb | 11 | ||||
-rw-r--r-- | app/models/tag_feed.rb | 1 |
3 files changed, 2 insertions, 11 deletions
diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index 15b91d63e..d253b744f 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -35,7 +35,6 @@ class Api::V1::Timelines::PublicController < Api::BaseController def public_feed PublicFeed.new( current_account, - locale: content_locale, local: truthy_param?(:local), remote: truthy_param?(:remote), only_media: truthy_param?(:only_media) diff --git a/app/models/public_feed.rb b/app/models/public_feed.rb index 2cf9206d2..1cfd9a500 100644 --- a/app/models/public_feed.rb +++ b/app/models/public_feed.rb @@ -8,7 +8,6 @@ class PublicFeed # @option [Boolean] :local # @option [Boolean] :remote # @option [Boolean] :only_media - # @option [String] :locale def initialize(account, options = {}) @account = account @options = options @@ -28,7 +27,7 @@ class PublicFeed scope.merge!(remote_only_scope) if remote_only? scope.merge!(account_filters_scope) if account? scope.merge!(media_only_scope) if media_only? - scope.merge!(language_scope) + scope.merge!(language_scope) if account&.chosen_languages.present? scope.cache_ids.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id) end @@ -86,13 +85,7 @@ class PublicFeed end def language_scope - if account&.chosen_languages.present? - Status.where(language: account.chosen_languages) - elsif @options[:locale].present? - Status.where(language: @options[:locale]) - else - Status.all - end + Status.where(language: account.chosen_languages) end def account_filters_scope diff --git a/app/models/tag_feed.rb b/app/models/tag_feed.rb index 8502b79af..b8cd63557 100644 --- a/app/models/tag_feed.rb +++ b/app/models/tag_feed.rb @@ -12,7 +12,6 @@ class TagFeed < PublicFeed # @option [Boolean] :local # @option [Boolean] :remote # @option [Boolean] :only_media - # @option [String] :locale def initialize(tag, account, options = {}) @tag = tag super(account, options) |