From 8a8c154b4eb5a271c9904a9bb21f4c5f2d985fe4 Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Wed, 18 Nov 2020 10:03:48 +0300 Subject: [PATCH] test fixes --- lib/pleroma/web/activity_pub/utils.ex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index f93909a50..ea1c3a04a 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -702,22 +702,22 @@ defmodule Pleroma.Web.ActivityPub.Utils do def make_flag_data(_, _), do: %{} - defp build_flag_object(%{account: account, statuses: statuses} = _) do - [account.ap_id] ++ build_flag_object(%{statuses: statuses}) + defp build_flag_object(%{account: account, statuses: statuses}) do + [account.ap_id | build_flag_object(%{statuses: statuses})] end defp build_flag_object(%{statuses: statuses}) do Enum.map(statuses || [], &build_flag_object/1) end - defp build_flag_object(%Activity{} = activity) do - activity_actor = User.get_by_ap_id(activity.object.data["actor"]) + defp build_flag_object(%Activity{data: %{"id" => id}, object: %{data: data}}) do + activity_actor = User.get_by_ap_id(data["actor"]) %{ "type" => "Note", - "id" => activity.data["id"], - "content" => activity.object.data["content"], - "published" => activity.object.data["published"], + "id" => id, + "content" => data["content"], + "published" => data["published"], "actor" => AccountView.render( "show.json",