X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fviews%2Fstatus_view.ex;h=f51a2ebb0e5ccd4d6039ce962886f1dfcf39da3b;hb=6c8d15da110e86f799052c82df8b7b2404f8f722;hp=c0e289ef8013b7ed3a1e6a1b9a84e0ed2ff627cd;hpb=681ba1e52f3ef27eb6b2407dfe85939714f67925;p=akkoma diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index c0e289ef8..f51a2ebb0 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -10,9 +10,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.CommonAPI.Utils - alias Pleroma.Web.MediaProxy alias Pleroma.Web.MastodonAPI.AccountView alias Pleroma.Web.MastodonAPI.StatusView + alias Pleroma.Web.MediaProxy # TODO: Add cached version. defp get_replied_to_activities(activities) do @@ -182,11 +182,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do end def render("card.json", %{rich_media: rich_media, page_url: page_url}) do + page_url_data = URI.parse(page_url) + page_url_data = if rich_media[:url] != nil do - URI.merge(URI.parse(page_url), URI.parse(rich_media[:url])) + URI.merge(page_url_data, URI.parse(rich_media[:url])) else - page_url + page_url_data end page_url = page_url_data |> to_string