diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-11-11 12:51:13 -0600 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-11-11 12:51:13 -0600 |
commit | 2254e5e5958803beef94e2d01bdb04647a1f82c9 (patch) | |
tree | 8633c6a095d35c11a9ab2b1d4704abcb7d47fdea | |
parent | 6fd72e9e8526680836e1bf34c58e10b66dcfee8c (diff) | |
download | pleroma-2254e5e5958803beef94e2d01bdb04647a1f82c9.tar.gz |
Render blurhashes in Mastodon API
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 3 | ||||
-rw-r--r-- | test/pleroma/web/mastodon_api/views/status_view_test.exs | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 435bcde15..7cbbd3750 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -435,7 +435,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do text_url: href, type: type, description: attachment["name"], - pleroma: %{mime_type: media_type} + pleroma: %{mime_type: media_type}, + blurhash: attachment["blurhash"] } end diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs index 70d829979..665199f97 100644 --- a/test/pleroma/web/mastodon_api/views/status_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs @@ -420,6 +420,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do "href" => "someurl" } ], + "blurhash" => "UJJ8X[xYW,%Jtq%NNFbXB5j]IVM|9GV=WHRn", "uuid" => 6 } @@ -431,7 +432,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do preview_url: "someurl", text_url: "someurl", description: nil, - pleroma: %{mime_type: "image/png"} + pleroma: %{mime_type: "image/png"}, + blurhash: "UJJ8X[xYW,%Jtq%NNFbXB5j]IVM|9GV=WHRn" } api_spec = Pleroma.Web.ApiSpec.spec() |