activitypub: note serializer: support _misskey keys

pull/36/head
Ariadne Conill 2022-12-25 04:56:56 +00:00
parent 14d001574c
commit b36e884cc1
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, :in_reply_to, :published, :url,
:attributed_to, :to, :cc, :sensitive, :attributed_to, :to, :cc, :sensitive,
:atom_uri, :in_reply_to_atom_uri, :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
attribute :content_map, if: :language? attribute :content_map, if: :language?
@ -150,9 +153,11 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
end end
def quote_url def quote_url
object.quote? ? ActivityPub::TagManager.instance.uri_for(object.quote) : nil ActivityPub::TagManager.instance.uri_for(object.quote) if object.quote?
end end
alias misskey_quote quote_url
def local? def local?
object.account.local? object.account.local?
end end