Make sure notice link is remote if the post is remote.
authorPhil Hagelberg <phil@hagelb.org>
Fri, 1 Nov 2019 01:26:34 +0000 (18:26 -0700)
committerPhil Hagelberg <phil@hagelb.org>
Sun, 10 Nov 2019 02:08:08 +0000 (18:08 -0800)
lib/pleroma/web/static_fe/static_fe_controller.ex

index c35657d8e97c94c0d428ceeeca87db1bb95f4023..5f69218ce70107a1bc4f68fcba9a12f6e0e0086e 100644 (file)
@@ -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,