Support objects with a nil contentMap (firefish)

Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3231
This commit is contained in:
Haelwenn (lanodan) Monnier 2024-01-11 07:13:13 +01:00
commit 7651198508
3 changed files with 18 additions and 0 deletions

View file

@ -339,6 +339,10 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
def fix_tag(object), do: object
def fix_content_map(%{"contentMap" => nil} = object) do
Map.drop(object, ["contentMap"])
end
# content map usually only has one language so this will do for now.
def fix_content_map(%{"contentMap" => content_map} = object) do
content_groups = Map.to_list(content_map)