|
|
@ -8,7 +8,6 @@ class PublicFeed
|
|
|
|
# @option [Boolean] :local
|
|
|
|
# @option [Boolean] :local
|
|
|
|
# @option [Boolean] :remote
|
|
|
|
# @option [Boolean] :remote
|
|
|
|
# @option [Boolean] :only_media
|
|
|
|
# @option [Boolean] :only_media
|
|
|
|
# @option [String] :locale
|
|
|
|
|
|
|
|
def initialize(account, options = {})
|
|
|
|
def initialize(account, options = {})
|
|
|
|
@account = account
|
|
|
|
@account = account
|
|
|
|
@options = options
|
|
|
|
@options = options
|
|
|
@ -28,7 +27,7 @@ class PublicFeed
|
|
|
|
scope.merge!(remote_only_scope) if remote_only?
|
|
|
|
scope.merge!(remote_only_scope) if remote_only?
|
|
|
|
scope.merge!(account_filters_scope) if account?
|
|
|
|
scope.merge!(account_filters_scope) if account?
|
|
|
|
scope.merge!(media_only_scope) if media_only?
|
|
|
|
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)
|
|
|
|
scope.cache_ids.to_a_paginated_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -86,13 +85,7 @@ class PublicFeed
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def language_scope
|
|
|
|
def language_scope
|
|
|
|
if account&.chosen_languages.present?
|
|
|
|
Status.where(language: account.chosen_languages)
|
|
|
|
Status.where(language: account.chosen_languages)
|
|
|
|
|
|
|
|
elsif @options[:locale].present?
|
|
|
|
|
|
|
|
Status.where(language: @options[:locale])
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
Status.all
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def account_filters_scope
|
|
|
|
def account_filters_scope
|
|
|
|