]> cat aescling's git repositories - mastodon.git/commitdiff
Do not ignore unknown media attachments, only skip them (#6948)
authorThibG <thib@sitedethib.com>
Wed, 28 Mar 2018 22:52:24 +0000 (00:52 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 28 Mar 2018 22:52:24 +0000 (00:52 +0200)
That way, they are displayed in a list below the corresponding toot.

app/lib/activitypub/activity/create.rb

index 676e885c0bb1f81ccf684daf08d27fac5cfd509d..afee8a268a3b57fbb4a796cb43ce7552d0ece3d1 100644 (file)
@@ -113,13 +113,13 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
     media_attachments = []
 
     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
       media_attachment = MediaAttachment.create(account: @account, remote_url: href, description: attachment['name'].presence, focus: attachment['focalPoint'])
       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.save