th: activitypub: note serializer: support _misskey keys

lolsob-rspec
Ariadne Conill 2022-12-25 04:56:56 +00:00
parent 55cd4f1024
commit 2b57535062
1 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
:in_reply_to, :published, :url,
:attributed_to, :to, :cc, :sensitive,
:atom_uri, :in_reply_to_atom_uri,
:conversation, :quote_url
:conversation
attribute :quote_url, if: -> { object.quote? }
attribute :misskey_quote, key: :_misskey_quote, if: -> { object.quote? }
attribute :content
attribute :content_map, if: :language?
@ -150,9 +153,11 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
end
def quote_url
object.quote? ? ActivityPub::TagManager.instance.uri_for(object.quote) : nil
ActivityPub::TagManager.instance.uri_for(object.quote) if object.quote?
end
alias misskey_quote quote_url
def local?
object.account.local?
end