about summary refs log tree commit diff
path: root/app/serializers/activitypub/outbox_serializer.rb
blob: 2692a1c42c0ece66293bfb6514ee1584888cf014 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class ActivityPub::OutboxSerializer < ActivityPub::CollectionSerializer
  def self.serializer_for(model, options)
    if model.class.name == 'ActivityPub::ActivityPresenter'
      ActivityPub::ActivitySerializer
    else
      super
    end
  end

  def items
    object.items.map { |status| ActivityPub::ActivityPresenter.from_status(status, embed: false) }
  end
end