Implement FEP 7888: Part 1 - publish conversation context (#35959)

This commit is contained in:
Jesse Karmani 2025-09-05 12:28:29 -07:00 committed by GitHub
parent 9463a31107
commit 65b4a0a6f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 309 additions and 12 deletions

View file

@ -0,0 +1,14 @@
# 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