]> cat aescling's git repositories - mastodon.git/commitdiff
Do not show media attachment as og:image if it was marked as NSFW (#1693)
authorIsabelle Knott <isabelle@blackle-mori.com>
Thu, 13 Apr 2017 13:59:43 +0000 (09:59 -0400)
committerEugen <eugen@zeonfederated.com>
Thu, 13 Apr 2017 13:59:43 +0000 (15:59 +0200)
app/views/stream_entries/show.html.haml

index f37fb79196c29037536f395b45e3212712c4b611..8629467503131ac8a7b36de544a4ce886b841a2a 100644 (file)
@@ -11,7 +11,7 @@
   - else
     %meta{ property: 'og:description', content: @stream_entry.activity.content }/
 
-  - if @stream_entry.activity.is_a?(Status) && @stream_entry.activity.media_attachments.size > 0
+  - if @stream_entry.activity.is_a?(Status) && !@stream_entry.activity.sensitive? && @stream_entry.activity.media_attachments.size > 0
     %meta{ property: 'og:image', content: full_asset_url(@stream_entry.activity.media_attachments.first.file.url(:small)) }/
   - else
     %meta{ property: 'og:image', content: full_asset_url(@account.avatar.url(:original)) }/