mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-23 10:43:19 +00:00
Implement FEP 7888: Part 1 - publish conversation context (#35959)
This commit is contained in:
parent
9463a31107
commit
65b4a0a6f1
15 changed files with 309 additions and 12 deletions
14
app/presenters/activitypub/context_presenter.rb
Normal file
14
app/presenters/activitypub/context_presenter.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue