Add references activitypub support

This commit is contained in:
KMY 2023-07-11 18:31:28 +09:00
parent 4c65f2721c
commit cadfbbab96
8 changed files with 115 additions and 5 deletions

View file

@ -3,13 +3,13 @@
class ActivityPub::NoteSerializer < ActivityPub::Serializer
include FormattingHelper
context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :searchable_by
context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :searchable_by, :references
attributes :id, :type, :summary,
:in_reply_to, :published, :url,
:attributed_to, :to, :cc, :sensitive,
:atom_uri, :in_reply_to_atom_uri,
:conversation, :searchable_by
:conversation, :searchable_by, :references
attribute :content
attribute :content_map, if: :language?
@ -64,6 +64,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
)
end
def references
ActivityPub::TagManager.instance.references_uri_for(object)
end
def language?
object.language.present?
end