Do not ignore unknown media attachments, only skip them (#6948)
That way, they are displayed in a list below the corresponding toot.
This commit is contained in:
parent
5021c4e9ca
commit
9ed5eebd7c
|
@ -113,13 +113,13 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||||
media_attachments = []
|
media_attachments = []
|
||||||
|
|
||||||
as_array(@object['attachment']).each do |attachment|
|
as_array(@object['attachment']).each do |attachment|
|
||||||
next if unsupported_media_type?(attachment['mediaType']) || attachment['url'].blank?
|
next if attachment['url'].blank?
|
||||||
|
|
||||||
href = Addressable::URI.parse(attachment['url']).normalize.to_s
|
href = Addressable::URI.parse(attachment['url']).normalize.to_s
|
||||||
media_attachment = MediaAttachment.create(account: @account, remote_url: href, description: attachment['name'].presence, focus: attachment['focalPoint'])
|
media_attachment = MediaAttachment.create(account: @account, remote_url: href, description: attachment['name'].presence, focus: attachment['focalPoint'])
|
||||||
media_attachments << media_attachment
|
media_attachments << media_attachment
|
||||||
|
|
||||||
next if skip_download?
|
next if unsupported_media_type?(attachment['mediaType']) || skip_download?
|
||||||
|
|
||||||
media_attachment.file_remote_url = href
|
media_attachment.file_remote_url = href
|
||||||
media_attachment.save
|
media_attachment.save
|
||||||
|
|
Reference in New Issue