mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 14:05:11 +01:00
a6328fc1b1
- Objects must have attributedTo instead of actor - The current attribute belongs to CollectionPage, not Collection
28 lines
739 B
Ruby
28 lines
739 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::OutboxesController < Api::BaseController
|
|
before_action :set_account
|
|
|
|
def show
|
|
@statuses = @account.statuses.permitted_for(@account, current_account).paginate_by_max_id(20, params[:max_id], params[:since_id])
|
|
@statuses = cache_collection(@statuses, Status)
|
|
|
|
render json: outbox_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter
|
|
end
|
|
|
|
private
|
|
|
|
def set_account
|
|
@account = Account.find_local!(params[:account_username])
|
|
end
|
|
|
|
def outbox_presenter
|
|
ActivityPub::CollectionPresenter.new(
|
|
id: account_outbox_url(@account),
|
|
type: :ordered,
|
|
size: @account.statuses_count,
|
|
items: @statuses
|
|
)
|
|
end
|
|
end
|