use media proxy for suggestions api

This commit is contained in:
Hakaba Hitoyo 2018-08-28 17:01:17 +09:00
parent 49b165ddc6
commit 6cbfb5ab5d

View file

@ -7,6 +7,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.OAuth.{Authorization, Token, App}
alias Pleroma.Web.MediaProxy
alias Comeonin.Pbkdf2
import Ecto.Query
require Logger
@ -1125,6 +1126,12 @@ def suggestions(%{assigns: %{user: user}} = conn, _) do
end
)
end)
|> Enum.map(fn x ->
Map.put(x, "avatar", MediaProxy.url(x["avatar"]))
end)
|> Enum.map(fn x ->
Map.put(x, "avatar_static", MediaProxy.url(x["avatar_static"]))
end)
conn
|> json(data2)