projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Use hash of attachment url as id.
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
status_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/status_view.ex
b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 686ffd29de26e6d4db5f2c6c554095ff163f591d..bf9862419c0a5ebc29f66127aabb037011aa9735 100644
(file)
--- 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,