mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-08 09:24:18 +00:00
Allow nil attachments
This commit is contained in:
parent
fa40db6b5a
commit
33e7ae7637
|
@ -919,9 +919,13 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepare_attachments(object) do
|
def prepare_attachments(object) do
|
||||||
|
attachments = case Map.get(object, "attachment", []) do
|
||||||
|
[_ | _] = list -> list
|
||||||
|
_ -> []
|
||||||
|
end
|
||||||
|
|
||||||
attachments =
|
attachments =
|
||||||
object
|
attachments
|
||||||
|> Map.get("attachment", [])
|
|
||||||
|> Enum.map(fn data ->
|
|> Enum.map(fn data ->
|
||||||
[%{"mediaType" => media_type, "href" => href} = url | _] = data["url"]
|
[%{"mediaType" => media_type, "href" => href} = url | _] = data["url"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue