logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 2254e5e5958803beef94e2d01bdb04647a1f82c9
parent 6fd72e9e8526680836e1bf34c58e10b66dcfee8c
Author: Mark Felder <feld@FreeBSD.org>
Date:   Wed, 11 Nov 2020 12:51:13 -0600

Render blurhashes in Mastodon API

Diffstat:

Mlib/pleroma/web/mastodon_api/views/status_view.ex3++-
Mtest/pleroma/web/mastodon_api/views/status_view_test.exs4+++-
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 @@ -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 @@ -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()