align upload.ex to latest commit 2641dcdd15

This commit is contained in:
Claudio Maradonna 2022-10-11 17:23:36 +02:00
parent d20f39f9a1
commit 4eb388f52b
Signed by untrusted user who does not match committer: claudiomaradonna
GPG key ID: 0CBA58694C5680D9

View file

@ -3,8 +3,6 @@
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Upload do defmodule Pleroma.Upload do
@behaviour Pleroma.Upload
@moduledoc """ @moduledoc """
Manage user uploads Manage user uploads
@ -38,6 +36,7 @@ defmodule Pleroma.Upload do
alias Ecto.UUID alias Ecto.UUID
alias Pleroma.Config alias Pleroma.Config
alias Pleroma.Maps alias Pleroma.Maps
alias Pleroma.Web.ActivityPub.Utils
require Logger require Logger
@type source :: @type source ::
@ -90,6 +89,7 @@ defmodule Pleroma.Upload do
{:ok, url_spec} <- Pleroma.Uploaders.Uploader.put_file(opts.uploader, upload) do {:ok, url_spec} <- Pleroma.Uploaders.Uploader.put_file(opts.uploader, upload) do
{:ok, {:ok,
%{ %{
"id" => Utils.generate_object_id(),
"type" => opts.activity_type, "type" => opts.activity_type,
"mediaType" => upload.content_type, "mediaType" => upload.content_type,
"url" => [ "url" => [