Improve status pin query (#11972)
This commit is contained in:
parent
860a77d45e
commit
059945c97c
|
@ -33,9 +33,9 @@ class ActivityPub::CollectionsController < ActivityPub::BaseController
|
||||||
def scope_for_collection
|
def scope_for_collection
|
||||||
case params[:id]
|
case params[:id]
|
||||||
when 'featured'
|
when 'featured'
|
||||||
@account.statuses.permitted_for(@account, signed_request_account).tap do |scope|
|
return Status.none if @account.blocking?(signed_request_account)
|
||||||
scope.merge!(@account.pinned_statuses)
|
|
||||||
end
|
@account.pinned_statuses
|
||||||
else
|
else
|
||||||
raise ActiveRecord::RecordNotFound
|
raise ActiveRecord::RecordNotFound
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,6 +57,8 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def pinned_scope
|
def pinned_scope
|
||||||
|
return Status.none if @account.blocking?(current_account)
|
||||||
|
|
||||||
@account.pinned_statuses
|
@account.pinned_statuses
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue