mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Serialize legacy quotes (#3203)
This commit is contained in:
@@ -33,7 +33,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
|
||||
attribute :voters_count, if: :poll_and_voters_count?
|
||||
|
||||
attribute :quote, if: :quote?
|
||||
attribute :quote, if: :nonlegacy_quote?
|
||||
attribute :quote, key: :_misskey_quote, if: :serializable_quote?
|
||||
attribute :quote, key: :quote_uri, if: :serializable_quote?
|
||||
attribute :quote_authorization, if: :quote_authorization?
|
||||
@@ -230,6 +230,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
object.quote&.quoted_status&.present?
|
||||
end
|
||||
|
||||
def nonlegacy_quote?
|
||||
object.quote.present? && !object.quote.legacy?
|
||||
end
|
||||
|
||||
def quote_authorization?
|
||||
object.quote.present? && ActivityPub::TagManager.instance.approval_uri_for(object.quote).present?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user