Use hash of attachment url as id.
[akkoma] / lib / pleroma / web / mastodon_api / views / status_view.ex
index 686ffd29de26e6d4db5f2c6c554095ff163f591d..bf9862419c0a5ebc29f66127aabb037011aa9735 100644 (file)
@@ -61,8 +61,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       true -> "unknown"
     end
 
+    << hash_id::32, _rest::binary >> = :crypto.hash(:md5, href)
+
     %{
-      id: attachment["uuid"],
+      id: attachment["id"] || hash_id,
       url: href,
       remote_url: href,
       preview_url: href,