2
0

Revoke quote posts when those get deleted (#35614)

This commit is contained in:
Claire
2025-07-31 16:23:36 +02:00
committed by GitHub
parent 19db4cb7c1
commit 0e249cba4b
2 changed files with 5 additions and 0 deletions

View File

@@ -298,6 +298,8 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
if @status.quote.present?
# If the quoted post has changed, discard the old object and create a new one
if @status.quote.quoted_status.present? && ActivityPub::TagManager.instance.uri_for(@status.quote.quoted_status) != quote_uri
# 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_changed = true

View File

@@ -47,6 +47,9 @@ class RemoveStatusService < BaseService
remove_media
end
# 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.destroy! if permanently?
end
end