From: Phil Hagelberg Date: Fri, 1 Nov 2019 01:26:34 +0000 (-0700) Subject: Make sure notice link is remote if the post is remote. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c6c706161e462bb6190cb4471e81e5a8c3b66d20;p=akkoma Make sure notice link is remote if the post is remote. --- diff --git a/lib/pleroma/web/static_fe/static_fe_controller.ex b/lib/pleroma/web/static_fe/static_fe_controller.ex index c35657d8e..5f69218ce 100644 --- a/lib/pleroma/web/static_fe/static_fe_controller.ex +++ b/lib/pleroma/web/static_fe/static_fe_controller.ex @@ -37,12 +37,19 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do def represent(%Activity{object: %Object{data: data}} = activity, selected) do {:ok, user} = User.get_or_fetch(activity.object.data["actor"]) + link = + if user.local do + Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity) + else + data["url"] || data["external_url"] || data["id"] + end + %{ user: user, title: get_title(activity.object), content: data["content"] || nil, attachment: data["attachment"], - link: Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity.id), + link: link, published: data["published"], sensitive: data["sensitive"], selected: selected,