X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fupload.ex;h=797555bffa324643d7105450f21cbc1090304c39;hb=0883a706dc376fdfb7de9df1366803e87c8e7c98;hp=762d813d98a279f409f248e148a5742a26a0e9d7;hpb=e8493431bfc16977e43715bf8bdb09ac46580028;p=akkoma diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 762d813d9..797555bff 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -67,6 +67,7 @@ defmodule Pleroma.Upload do {:ok, %{ "type" => opts.activity_type, + "mediaType" => upload.content_type, "url" => [ %{ "type" => "Link", @@ -134,7 +135,7 @@ defmodule Pleroma.Upload do end end - defp prepare_upload(%{"img" => "data:image/" <> image_data}, opts) do + defp prepare_upload(%{img: "data:image/" <> image_data}, opts) do parsed = Regex.named_captures(~r/(?jpeg|png|gif);base64,(?.*)/, image_data) data = Base.decode64!(parsed["data"], ignore: :whitespace) hash = String.downcase(Base.encode16(:crypto.hash(:sha256, data)))