Fix crash when serializing quotes of deleted posts for ActivityPub (#36381)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user