You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app/presenters/activitypub/context_presenter.rb

15 lines
457 B
Ruby

# frozen_string_literal: true
class ActivityPub::ContextPresenter < ActiveModelSerializers::Model
attributes :id, :type, :attributed_to, :first, :object_type
class << self
def from_conversation(conversation)
new.tap do |presenter|
presenter.id = ActivityPub::TagManager.instance.uri_for(conversation)
presenter.attributed_to = ActivityPub::TagManager.instance.uri_for(conversation.parent_account)
end
end
end
end