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