Add: fep-e232引用仕様 (#725)

* Add: fep-e232引用仕様

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-04-23 19:48:16 +09:00 committed by GitHub
parent eb28fa8e53
commit f29f3c5c85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 5 deletions

View file

@ -634,7 +634,18 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
end
def quote
@quote ||= @object['quote'] || @object['quoteUrl'] || @object['quoteURL'] || @object['_misskey_quote']
@quote ||= quote_from_tags || @object['quote'] || @object['quoteUrl'] || @object['quoteURL'] || @object['_misskey_quote']
end
LINK_MEDIA_TYPES = ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].freeze
def quote_from_tags
return @quote_from_tags if defined?(@quote_from_tags)
hit_tag = as_array(@object['tag']).detect do |tag|
equals_or_includes?(tag['type'], 'Link') && LINK_MEDIA_TYPES.include?(tag['mediaType']) && tag['href'].present?
end
@quote_from_tags = hit_tag && hit_tag['href']
end
def join_group!