Add initial support for ingesting and verifying remote quote posts (#34370)
This commit is contained in:
		@@ -10,6 +10,8 @@ class REST::StatusEditSerializer < ActiveModel::Serializer
 | 
			
		||||
  has_many :ordered_media_attachments, key: :media_attachments, serializer: REST::MediaAttachmentSerializer
 | 
			
		||||
  has_many :emojis, serializer: REST::CustomEmojiSerializer
 | 
			
		||||
 | 
			
		||||
  has_one :quote, serializer: REST::QuoteSerializer, if: -> { object.quote_id.present? }
 | 
			
		||||
 | 
			
		||||
  attribute :poll, if: -> { object.poll_options.present? }
 | 
			
		||||
 | 
			
		||||
  def content
 | 
			
		||||
@@ -19,4 +21,8 @@ class REST::StatusEditSerializer < ActiveModel::Serializer
 | 
			
		||||
  def poll
 | 
			
		||||
    { options: object.poll_options.map { |title| { title: title } } }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def quote
 | 
			
		||||
    object.quote_id == status.quote&.id ? status.quote : Quote.new(state: :pending)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user