mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
30 lines
591 B
Ruby
30 lines
591 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ActivityPub::QuoteRequestSerializer < ActivityPub::Serializer
|
|
context_extensions :quote_requests
|
|
|
|
attributes :id, :type, :actor, :instrument
|
|
attribute :virtual_object, key: :object
|
|
|
|
def id
|
|
object.activity_uri
|
|
end
|
|
|
|
def type
|
|
'QuoteRequest'
|
|
end
|
|
|
|
def actor
|
|
ActivityPub::TagManager.instance.uri_for(object.account)
|
|
end
|
|
|
|
def virtual_object
|
|
ActivityPub::TagManager.instance.uri_for(object.quoted_status)
|
|
end
|
|
|
|
def instrument
|
|
# TODO: inline object?
|
|
ActivityPub::TagManager.instance.uri_for(object.status)
|
|
end
|
|
end
|