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

@@ -118,6 +118,14 @@ class ActivityPub::Parser::StatusParser
flags
end
def quote?
%w(quote _misskey_quote quoteUrl quoteUri).any? { |key| @object[key].present? }
end
def deleted_quote?
@object['quote'].is_a?(Hash) && @object['quote']['type'] == 'Tombstone'
end
def quote_uri
%w(quote _misskey_quote quoteUrl quoteUri).filter_map do |key|
value_or_id(as_array(@object[key]).first)