diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-10-05 02:14:21 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-10-05 02:14:21 -0500 |
commit | ce6a7055159a169ca38162eb2e38825f9331c8d9 (patch) | |
tree | 12095e46b9df1c8f33a981930aa22ba5ca90d680 /app/controllers/api/v1/timelines/public_controller.rb | |
parent | a9631d4601c6eef08751122a0ba7897609f3eca8 (diff) |
apply custom filters to world and tag timelines the slow way until the custom filter system gets changed
Diffstat (limited to 'app/controllers/api/v1/timelines/public_controller.rb')
-rw-r--r-- | app/controllers/api/v1/timelines/public_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index 9c3f6c0a8..66079140b 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -1,12 +1,14 @@ # frozen_string_literal: true class Api::V1::Timelines::PublicController < Api::BaseController + include FilterHelper + after_action :insert_pagination_headers, unless: -> { @statuses.empty? } respond_to :json def show - @statuses = load_statuses + @statuses = current_account ? load_statuses.reject { |status| phrase_filtered?(status, current_account.id, 'public') } : load_statuses render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id) end @@ -37,7 +39,7 @@ class Api::V1::Timelines::PublicController < Api::BaseController end def public_timeline_statuses - Status.as_public_timeline(current_account, truthy_param?(:local)) + statuses = Status.as_public_timeline(current_account, truthy_param?(:local)) end def insert_pagination_headers |