2
0

Fix crash when serializing quotes of deleted posts for ActivityPub (#36381)

This commit is contained in:
Claire
2025-10-09 15:52:38 +02:00
committed by GitHub
parent b7c5e60426
commit d4a4a7177a
8 changed files with 97 additions and 8 deletions

View File

@@ -300,7 +300,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
def update_quote!
quote_uri = @status_parser.quote_uri
if quote_uri.present?
if @status_parser.quote?
approval_uri = @status_parser.quote_approval_uri
approval_uri = nil if unsupported_uri_scheme?(approval_uri) || TagManager.instance.local_url?(approval_uri)
@@ -310,7 +310,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
# Revoke the quote while we get a chance… maybe this should be a `before_destroy` hook?
RevokeQuoteService.new.call(@status.quote) if @status.quote.quoted_account&.local? && @status.quote.accepted?
@status.quote.destroy
quote = Quote.create(status: @status, approval_uri: approval_uri, legacy: @status_parser.legacy_quote?)
quote = Quote.create(status: @status, approval_uri: approval_uri, legacy: @status_parser.legacy_quote?, state: @status_parser.deleted_quote? ? :deleted : :pending)
@quote_changed = true
else
quote = @status.quote