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,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ActivityPub::ContextSerializer < ActivityPub::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :type, :attributed_to, :first
|
||||
|
||||
def type
|
||||
'Collection'
|
||||
end
|
||||
end
|
||||
@@ -9,7 +9,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
:in_reply_to, :published, :url,
|
||||
:attributed_to, :to, :cc, :sensitive,
|
||||
:atom_uri, :in_reply_to_atom_uri,
|
||||
:conversation
|
||||
:conversation, :context
|
||||
|
||||
attribute :content
|
||||
attribute :content_map, if: :language?
|
||||
@@ -163,6 +163,12 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
end
|
||||
end
|
||||
|
||||
def context
|
||||
return if object.conversation.nil?
|
||||
|
||||
ActivityPub::TagManager.instance.uri_for(object.conversation)
|
||||
end
|
||||
|
||||
def local?
|
||||
object.account.local?
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user