# frozen_string_literal: true
class ActivityPub::ActivitySerializer < ActiveModel::Serializer
attributes :id, :type, :actor, :published, :to, :cc
has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer
def id
[ActivityPub::TagManager.instance.activity_uri_for(object)].join
end
def type
announce? ? 'Announce' : 'Create'
def actor
ActivityPub::TagManager.instance.uri_for(object.account)
def published
object.created_at.iso8601
def to
ActivityPub::TagManager.instance.to(object)
def cc
ActivityPub::TagManager.instance.cc(object)
def announce?
object.reblog?