Merge branch 'develop' into feld-2168-media-preview-proxy
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index 01b8bb6bb1b1cfd8ac76adc5f04cb758b84257e2..1408a3adde100b765b719996bebeb27a541e1f74 100644 (file)
@@ -417,6 +417,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     [attachment_url | _] = attachment["url"]
     media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"
     href = attachment_url["href"] |> MediaProxy.url()
+    href_preview = attachment_url["href"] |> MediaProxy.preview_url()
 
     type =
       cond do
@@ -432,7 +433,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       id: to_string(attachment["id"] || hash_id),
       url: href,
       remote_url: href,
-      preview_url: href,
+      preview_url: href_preview,
       text_url: href,
       type: type,
       description: attachment["name"],