From b58b35bf5619bd3b4d89a224e3b032c230c01884 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 12 Sep 2017 11:28:12 +0200 Subject: Use hash of attachment url as id. Pretty hacky, let's see if we can get away with this. --- lib/pleroma/web/mastodon_api/views/status_view.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 686ffd29d..bf9862419 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -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, -- cgit v1.2.3