Implement FEP 7888: Part 1 - publish conversation context (#35959)
This commit is contained in:
1 parent
9463a31107
commit
65b4a0a6f1
15 files changed
+309
-12
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user