X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fstatic_fe%2Fstatic_fe_controller.ex;h=50f0927a36c207863cb4a372856a8b1fa9245b51;hb=d87dfcb5f0f91ad6fa9fccd47996c2bc54701553;hp=76b82589f4192f32d4aeac27ea337dc8838b0a8e;hpb=6c2264af24e70e8279508e0166350e8034e139e4;p=akkoma
diff --git a/lib/pleroma/web/static_fe/static_fe_controller.ex b/lib/pleroma/web/static_fe/static_fe_controller.ex
index 76b82589f..50f0927a3 100644
--- a/lib/pleroma/web/static_fe/static_fe_controller.ex
+++ b/lib/pleroma/web/static_fe/static_fe_controller.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.StaticFE.StaticFEController do
@@ -14,12 +14,11 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
alias Pleroma.Web.Router.Helpers
plug(:put_layout, :static_fe)
- plug(:put_view, Pleroma.Web.StaticFE.StaticFEView)
plug(:assign_id)
@page_keys ["max_id", "min_id", "limit", "since_id", "order"]
- @doc "Renders requested local public activity"
+ @doc "Renders requested local public activity or public activities of requested user"
def show(%{assigns: %{notice_id: notice_id}} = conn, _params) do
with %Activity{local: true} = activity <-
Activity.get_by_id_with_object(notice_id),
@@ -46,7 +45,6 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
end
end
- @doc "Renders public activities of requested user"
def show(%{assigns: %{username_or_id: username_or_id}} = conn, params) do
with {_, %User{local: true} = user} <-
{:fetch_user, User.get_cached_by_nickname_or_id(username_or_id)},
@@ -123,7 +121,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
end
defp get_counts(%Activity{} = activity) do
- %Object{data: data} = Object.normalize(activity)
+ %Object{data: data} = Object.normalize(activity, fetch: false)
%{
likes: data["like_count"] || 0,