+ def delete_post(%{assigns: %{user: user}} = conn, %{"id" => id}) do
+ with %Activity{data: %{"object" => %{"id" => object_id}}} <- Repo.get(Activity, id),
+ %Object{} = object <- Object.get_by_ap_id(object_id),
+ true <- user.ap_id == object.data["actor"],
+ {:ok, delete} <- ActivityPub.delete(object) |> IO.inspect do
+ json = ActivityRepresenter.to_json(delete, %{user: user, for: user})
+ conn
+ |> json_reply(200, json)
+ end
+ end
+