mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Fix crash when serializing quotes of deleted posts for ActivityPub (#36381)
This commit is contained in:
parent
b7c5e60426
commit
d4a4a7177a
8 changed files with 97 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue