Fix OStatus controller to know about StaticFEController.

But only when it's configured to be on.
This commit is contained in:
Phil Hagelberg 2019-10-27 19:01:18 -07:00
parent e79d8985ab
commit 0cf04e1088
1 changed files with 33 additions and 29 deletions

View File

@ -76,6 +76,9 @@ def activity(%{assigns: %{format: format}} = conn, %{"uuid" => uuid}) do
end
def notice(%{assigns: %{format: format}} = conn, %{"id" => id}) do
if Pleroma.Config.get([:instance, :static_fe], false) do
Pleroma.Web.StaticFE.StaticFEController.show(conn, %{"notice_id" => id})
else
with {_, %Activity{} = activity} <- {:activity, Activity.get_by_id_with_object(id)},
{_, true} <- {:public?, Visibility.is_public?(activity)},
%User{} = user <- User.get_cached_by_ap_id(activity.data["actor"]) do
@ -109,6 +112,7 @@ def notice(%{assigns: %{format: format}} = conn, %{"id" => id}) do
e
end
end
end
# Returns an HTML embedded <audio> or <video> player suitable for embed iframes.
def notice_player(conn, %{"id" => id}) do