From ce6a7055159a169ca38162eb2e38825f9331c8d9 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 5 Oct 2019 02:14:21 -0500 Subject: apply custom filters to world and tag timelines the slow way until the custom filter system gets changed --- app/controllers/api/v1/timelines/tag_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/controllers/api/v1/timelines/tag_controller.rb') diff --git a/app/controllers/api/v1/timelines/tag_controller.rb b/app/controllers/api/v1/timelines/tag_controller.rb index 126ffb5dc..f6ca033c7 100644 --- a/app/controllers/api/v1/timelines/tag_controller.rb +++ b/app/controllers/api/v1/timelines/tag_controller.rb @@ -1,13 +1,15 @@ # frozen_string_literal: true class Api::V1::Timelines::TagController < Api::BaseController + include FilterHelper + before_action :load_tag 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 @@ -47,7 +49,7 @@ class Api::V1::Timelines::TagController < Api::BaseController end def tag_timeline_statuses - HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none), current_account, truthy_param?(:local)) + statuses = HashtagQueryService.new.call(@tag, params.slice(:any, :all, :none), current_account, truthy_param?(:local)) end def bookmark_results -- cgit