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
|
@ -297,14 +297,12 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
end
|
||||
|
||||
def process_quote
|
||||
return unless Mastodon::Feature.inbound_quotes_enabled?
|
||||
|
||||
@quote_uri = @status_parser.quote_uri
|
||||
return if @quote_uri.blank?
|
||||
|
||||
approval_uri = @status_parser.quote_approval_uri
|
||||
approval_uri = nil if unsupported_uri_scheme?(approval_uri)
|
||||
@quote = Quote.new(account: @account, approval_uri: approval_uri)
|
||||
@quote = Quote.new(account: @account, approval_uri: approval_uri, legacy: @status_parser.legacy_quote?)
|
||||
end
|
||||
|
||||
def process_hashtag(tag)
|
||||
|
|
|
@ -4,7 +4,6 @@ class ActivityPub::Activity::QuoteRequest < ActivityPub::Activity
|
|||
include Payloadable
|
||||
|
||||
def perform
|
||||
return unless Mastodon::Feature.inbound_quotes_enabled?
|
||||
return if non_matching_uri_hosts?(@account.uri, @json['id'])
|
||||
|
||||
quoted_status = status_from_uri(object_uri)
|
||||
|
|
|
@ -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