about summary refs log tree commit diff
path: root/app/serializers/activitypub/outbox_serializer.rb
blob: 4de619efc4dc7a178be55b691743e3f4ec487236 (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, instance_options[:domain]) }
  end
end