X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Futils.ex;h=e87d09134508ad2ad8a0bc9d94b24a5e565dcb8e;hb=a879c396bb3a07929d4821ef2c29610808962c6d;hp=d91abf7b3283b38cd791a1d26c48ed271328b87b;hpb=5135656f579954cf786011b539934c7150e0d0bc;p=akkoma diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index d91abf7b3..e87d09134 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -787,6 +787,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do params |> Map.put("type", "Flag") |> Map.put("skip_preload", true) + |> Map.put("preload_report_notes", true) |> Map.put("total", true) |> Map.put("limit", page_size) |> Map.put("offset", (page - 1) * page_size) @@ -798,11 +799,18 @@ defmodule Pleroma.Web.ActivityPub.Utils do reports = get_reports_by_status_id(activity["id"]) max_date = Enum.max_by(reports, &NaiveDateTime.from_iso8601!(&1.data["published"])) actors = Enum.map(reports, & &1.user_actor) + [%{data: %{"object" => [account_id | _]}} | _] = reports + + account = + AccountView.render("show.json", %{ + user: User.get_by_ap_id(account_id) + }) + status = get_status_data(activity) %{ date: max_date.data["published"], - account: activity["actor"], + account: account, status: status, actors: Enum.uniq(actors), reports: reports