test fixes

This commit is contained in:
Alexander Strizhakov 2020-11-18 10:03:48 +03:00
parent 44f3795b8e
commit 8a8c154b4e
No known key found for this signature in database
GPG key ID: 022896A53AEF1381

View file

@ -702,22 +702,22 @@ def make_flag_data(%{actor: actor, context: context, content: content} = params,
def make_flag_data(_, _), do: %{} def make_flag_data(_, _), do: %{}
defp build_flag_object(%{account: account, statuses: statuses} = _) do defp build_flag_object(%{account: account, statuses: statuses}) do
[account.ap_id] ++ build_flag_object(%{statuses: statuses}) [account.ap_id | build_flag_object(%{statuses: statuses})]
end end
defp build_flag_object(%{statuses: statuses}) do defp build_flag_object(%{statuses: statuses}) do
Enum.map(statuses || [], &build_flag_object/1) Enum.map(statuses || [], &build_flag_object/1)
end end
defp build_flag_object(%Activity{} = activity) do defp build_flag_object(%Activity{data: %{"id" => id}, object: %{data: data}}) do
activity_actor = User.get_by_ap_id(activity.object.data["actor"]) activity_actor = User.get_by_ap_id(data["actor"])
%{ %{
"type" => "Note", "type" => "Note",
"id" => activity.data["id"], "id" => id,
"content" => activity.object.data["content"], "content" => data["content"],
"published" => activity.object.data["published"], "published" => data["published"],
"actor" => "actor" =>
AccountView.render( AccountView.render(
"show.json", "show.json",