activitypub: note serializer: support _misskey keys
parent
14d001574c
commit
b36e884cc1
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue