test fixes
This commit is contained in:
parent
44f3795b8e
commit
8a8c154b4e
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue