1
0
Fork 0
forked from gitea/nas

Add support for importing embedded self-quotes (#34584)

This commit is contained in:
Claire 2025-05-05 10:01:16 +02:00 committed by GitHub
parent d41a741e00
commit cbaba54e9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 67 additions and 16 deletions

View file

@ -204,7 +204,9 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
@quote.status = status
@quote.save
ActivityPub::VerifyQuoteService.new.call(@quote, fetchable_quoted_uri: @quote_uri, request_id: @options[:request_id])
embedded_quote = safe_prefetched_embed(@account, @status_parser.quoted_object, @json['context'])
ActivityPub::VerifyQuoteService.new.call(@quote, fetchable_quoted_uri: @quote_uri, prefetched_quoted_object: embedded_quote, request_id: @options[:request_id])
rescue Mastodon::UnexpectedResponseError, *Mastodon::HTTP_CONNECTION_ERRORS
ActivityPub::RefetchAndVerifyQuoteWorker.perform_in(rand(30..600).seconds, @quote.id, @quote_uri, { 'request_id' => @options[:request_id] })
end