Merge branch 'develop' into media-preview-proxy
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index 3fe1967be98bf7d62635f0dc1cb091cfd2886a17..0882d680e63aefcc833544eb34f2d2250e09e4d1 100644 (file)
@@ -433,6 +433,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
@@ -448,7 +449,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"],