From: Alexander Strizhakov Date: Wed, 18 Nov 2020 07:03:48 +0000 (+0300) Subject: test fixes X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8a8c154b4eb5a271c9904a9bb21f4c5f2d985fe4;p=akkoma test fixes --- 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",