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
1 changed files with 7 additions and 7 deletions

View File

@ -702,22 +702,22 @@ def make_flag_data(%{actor: actor, context: context, content: content} = params,
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",