0
0
Fork 0

Change link previews to keep original URL from the status (#27312)

This commit is contained in:
Eugen Rochko 2023-11-13 10:58:28 +01:00 committed by GitHub
parent 9dc3ce878b
commit 0d14fcebae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 70 additions and 30 deletions

View file

@ -8,6 +8,10 @@ class REST::PreviewCardSerializer < ActiveModel::Serializer
:provider_url, :html, :width, :height,
:image, :image_description, :embed_url, :blurhash, :published_at
def url
object.original_url.presence || object.url
end
def image
object.image? ? full_asset_url(object.image.url(:original)) : nil
end