Actually fix incoming attachments.

This commit is contained in:
lain 2018-02-18 13:03:40 +01:00
commit 6046f10431
3 changed files with 14 additions and 3 deletions

View file

@ -17,9 +17,9 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
end
def fix_attachments(object) do
attachments = object["attachment"] || []
attachments = (object["attachment"] || [])
|> Enum.map(fn (data) ->
url = [%{"type" => "Link", "mediaType" => data["mediaType"], "url" => data["url"]}]
url = [%{"type" => "Link", "mediaType" => data["mediaType"], "href" => data["url"]}]
Map.put(data, "url", url)
end)