From afd83db0d7be4890dd345ba1f78e46da8b74d449 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 19 Jan 2019 10:58:27 +0300 Subject: [PATCH] Provide local og:url for remote activities --- lib/pleroma/web/metadata/opengraph.ex | 3 ++- lib/pleroma/web/ostatus/ostatus_controller.ex | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/metadata/opengraph.ex b/lib/pleroma/web/metadata/opengraph.ex index 1028e35c2..30333785e 100644 --- a/lib/pleroma/web/metadata/opengraph.ex +++ b/lib/pleroma/web/metadata/opengraph.ex @@ -13,6 +13,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do @impl Provider def build_tags(%{ object: object, + url: url, user: user }) do attachments = build_attachments(object) @@ -37,7 +38,7 @@ def build_tags(%{ property: "og:title", content: "#{user.name}" <> content ], []}, - {:meta, [property: "og:url", content: object.data["id"]], []}, + {:meta, [property: "og:url", content: url], []}, {:meta, [ property: "og:description", diff --git a/lib/pleroma/web/ostatus/ostatus_controller.ex b/lib/pleroma/web/ostatus/ostatus_controller.ex index 4844b84ad..f04754f08 100644 --- a/lib/pleroma/web/ostatus/ostatus_controller.ex +++ b/lib/pleroma/web/ostatus/ostatus_controller.ex @@ -150,6 +150,7 @@ def notice(conn, %{"id" => id}) do Fallback.RedirectController.redirector_with_meta(conn, %{ object: object, + url: Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity.id), user: user }) else