Merge remote-tracking branch 'parent/main' into kbtopic-remove-quote
This commit is contained in:
commit
f3c3ea42c2
301 changed files with 6618 additions and 3070 deletions
|
@ -15,7 +15,7 @@ class ActivityPub::Parser::MediaAttachmentParser
|
|||
end
|
||||
|
||||
def remote_url
|
||||
url = Addressable::URI.parse(@json['url'])&.normalize&.to_s
|
||||
url = Addressable::URI.parse(url_to_href(@json['url']))&.normalize&.to_s
|
||||
url unless unsupported_uri_scheme?(url)
|
||||
rescue Addressable::URI::InvalidURIError
|
||||
nil
|
||||
|
@ -43,7 +43,7 @@ class ActivityPub::Parser::MediaAttachmentParser
|
|||
end
|
||||
|
||||
def file_content_type
|
||||
@json['mediaType']
|
||||
@json['mediaType'] || url_to_media_type(@json['url'])
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -157,6 +157,10 @@ class ActivityPub::Parser::StatusParser
|
|||
end.first
|
||||
end
|
||||
|
||||
def legacy_quote?
|
||||
!@object.key?('quote')
|
||||
end
|
||||
|
||||
# The inlined quote; out of the attributes we support, only `https://w3id.org/fep/044f#quote` explicitly supports inlined objects
|
||||
def quoted_object
|
||||
as_array(@object['quote']).first
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue