mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
23 lines
500 B
Ruby
23 lines
500 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::ActivitySerializer < ActivityPub::Serializer
|
|
def self.serializer_for(model, options)
|
|
case model.class.name
|
|
when 'Status'
|
|
ActivityPub::NoteSerializer
|
|
when 'DeliverToDeviceService::EncryptedMessage'
|
|
ActivityPub::EncryptedMessageSerializer
|
|
else
|
|
super
|
|
end
|
|
end
|
|
|
|
attributes :id, :type, :actor, :published, :to, :cc
|
|
|
|
has_one :virtual_object, key: :object
|
|
|
|
def published
|
|
object.published.iso8601
|
|
end
|
|
end
|