logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 0b5a2bbe5b08d8b02c2b72c7b80fb55a7dc12535
parent: 631eed8799b25ff26c8fd7b3ff6f7063bdd88d01
Author: lain <lain@soykaf.club>
Date:   Sat, 15 Feb 2020 12:56:32 +0000

Merge branch 'bugfix/link-preview-site_name' into 'develop'

MastodonAPI.StatusView: Do not use site_name

See merge request pleroma/pleroma!2216

Diffstat:

Mlib/pleroma/web/mastodon_api/views/status_view.ex4+---
Mtest/web/mastodon_api/views/status_view_test.exs4++--
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -321,11 +321,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do nil end - site_name = rich_media[:site_name] || page_url_data.host - %{ type: "link", - provider_name: site_name, + provider_name: page_url_data.host, provider_url: page_url_data.scheme <> "://" <> page_url_data.host, url: page_url, image: image_url |> MediaProxy.url(), diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs @@ -491,7 +491,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do title: "Example website" } - %{provider_name: "Example site name"} = + %{provider_name: "example.com"} = StatusView.render("card.json", %{page_url: page_url, rich_media: card}) end @@ -506,7 +506,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do description: "Example description" } - %{provider_name: "Example site name"} = + %{provider_name: "example.com"} = StatusView.render("card.json", %{page_url: page_url, rich_media: card}) end end