Improve status pin query (#11972)

master
abcang 5 years ago committed by Eugen Rochko
parent 860a77d45e
commit 059945c97c
  1. 6
      app/controllers/activitypub/collections_controller.rb
  2. 2
      app/controllers/api/v1/accounts/statuses_controller.rb

@ -33,9 +33,9 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController
def scope_for_collection
case params[:id]
when 'featured'
@account.statuses.permitted_for(@account, signed_request_account).tap do |scope|
scope.merge!(@account.pinned_statuses)
end
return Status.none if @account.blocking?(signed_request_account)
@account.pinned_statuses
else
raise ActiveRecord::RecordNotFound
end

@ -57,6 +57,8 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
end
def pinned_scope
return Status.none if @account.blocking?(current_account)
@account.pinned_statuses
end

Loading…
Cancel
Save