1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.AdminAPI.Report do
9 def extract_report_info(
10 %{data: %{"actor" => actor, "object" => [account_ap_id | status_ap_ids]}} = report
12 user = User.get_cached_by_ap_id(actor)
13 account = User.get_cached_by_ap_id(account_ap_id)
16 Enum.map(status_ap_ids, fn
17 act when is_map(act) -> Activity.get_by_ap_id_with_object(act["id"])
18 act when is_binary(act) -> Activity.get_by_ap_id_with_object(act)
21 %{report: report, user: user, account: account, statuses: statuses}