diff options
Diffstat (limited to 'app/controllers/tags_controller.rb')
-rw-r--r-- | app/controllers/tags_controller.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 9cba38771..368419ef5 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -9,13 +9,13 @@ class TagsController < ApplicationController layout 'public' before_action :require_signature!, if: -> { request.format == :json && authorized_fetch_mode? } - #before_action :authenticate_user!, if: :whitelist_mode? + # before_action :authenticate_user!, if: :whitelist_mode? before_action :set_tag before_action :set_local before_action :set_body_classes before_action :set_instance_presenter - skip_before_action :require_functional! #, unless: :whitelist_mode? + skip_before_action :require_functional! # , unless: :whitelist_mode? def show respond_to do |format| @@ -38,11 +38,11 @@ class TagsController < ApplicationController expires_in 3.minutes, public: public_fetch_mode? @statuses = HashtagQueryService.new.call(@tag, filter_params, current_account, @local) - @statuses = @statuses.without_semiprivate unless known_visitor? + @statuses = @statuses.without_semiprivate unless authenticated_or_following?(@account) @statuses = @statuses.paginate_by_max_id(PAGE_SIZE, params[:max_id]) @statuses = cache_collection(@statuses, Status) - render json: collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json', target_domain: signed_request_account&.domain + render json: collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, content_type: 'application/activity+json', target_domain: current_account&.domain end end end @@ -77,8 +77,4 @@ class TagsController < ApplicationController def filter_params params.slice(:any, :all, :none).permit(:any, :all, :none) end - - def known_visitor? - @known_visitor ||= user_signed_in? || (signed_request_account.present? && signed_request_account.following?(@account)) - end end |