aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-09-12 11:28:12 +0200
committerRoger Braun <roger@rogerbraun.net>2017-09-12 11:28:12 +0200
commitb58b35bf5619bd3b4d89a224e3b032c230c01884 (patch)
tree00296dc025aeaaffc65e3a04fd875fd3b55529a5 /lib
parent44a650235bcb49900a84f50b2ee4d75593231c38 (diff)
downloadpleroma-b58b35bf5619bd3b4d89a224e3b032c230c01884.tar.gz
Use hash of attachment url as id.
Pretty hacky, let's see if we can get away with this.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex4
1 files changed, 3 insertions, 1 deletions
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,