Move maybe_add_content_map out of Transmogrifier, use code from tusooa's branch for MapOfString
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
edc8689d91
commit
62340b50b5
9 changed files with 194 additions and 71 deletions
|
|
@ -682,7 +682,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
|> add_mention_tags
|
||||
|> add_emoji_tags
|
||||
|> add_attributed_to
|
||||
|> maybe_add_content_map
|
||||
|> prepare_attachments
|
||||
|> set_conversation
|
||||
|> set_reply_to_uri
|
||||
|
|
@ -956,11 +955,4 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
def maybe_fix_user_url(data), do: data
|
||||
|
||||
def maybe_fix_user_object(data), do: maybe_fix_user_url(data)
|
||||
|
||||
defp maybe_add_content_map(%{"language" => language, "content" => content} = object)
|
||||
when not_empty_string(language) do
|
||||
Map.put(object, "contentMap", Map.put(%{}, language, content))
|
||||
end
|
||||
|
||||
defp maybe_add_content_map(object), do: object
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue