Add experimental basic quote post authoring (#35355)
This commit is contained in:
@@ -32,6 +32,7 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
has_one :quote, key: :quote, serializer: REST::QuoteSerializer
|
||||
has_one :preview_card, key: :card, serializer: REST::PreviewCardSerializer
|
||||
has_one :preloadable_poll, key: :poll, serializer: REST::PollSerializer
|
||||
has_one :quote_approval, if: -> { Mastodon::Feature.outgoing_quotes_enabled? }
|
||||
|
||||
def quote
|
||||
object.quote if object.quote&.acceptable?
|
||||
@@ -159,6 +160,14 @@ class REST::StatusSerializer < ActiveModel::Serializer
|
||||
object.active_mentions.to_a.sort_by(&:id)
|
||||
end
|
||||
|
||||
def quote_approval
|
||||
{
|
||||
automatic: object.quote_policy_as_keys(:automatic),
|
||||
manual: object.quote_policy_as_keys(:manual),
|
||||
current_user: object.quote_policy_for_account(current_user&.account),
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def relationships
|
||||
|
||||
Reference in New Issue
Block a user