Skip to content

Commit

Permalink
Store preview image for embedded photo in preview cards (#5986)
Browse files Browse the repository at this point in the history
The preview image would be useful to embed in timeline.
  • Loading branch information
akihikodaki authored and Gargron committed Dec 12, 2017
1 parent 2a61b9f commit f9f6918
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/services/fetch_link_card_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def attempt_oembed
when 'photo'
return false unless response.respond_to?(:url)
@card.embed_url = response.url
@card.image = URI.parse(response.url)
@card.width = response.width.presence || 0
@card.height = response.height.presence || 0
when 'video'
Expand Down

0 comments on commit f9f6918

Please sign in to comment.