transmogrifier.ex: Add fix_summary/1
MRF.KeywordPolicy assumes that summary is present in a activity, and this would probably simplify code elsewhere too anyway.
This commit is contained in:
parent
3f8be270c6
commit
cf9ba8fe1b
@ -83,6 +83,22 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
|> fix_content_map
|
|> fix_content_map
|
||||||
|> fix_likes
|
|> fix_likes
|
||||||
|> fix_addressing
|
|> fix_addressing
|
||||||
|
|> fix_summary
|
||||||
|
end
|
||||||
|
|
||||||
|
def fix_summary(%{"summary" => nil} = object) do
|
||||||
|
object
|
||||||
|
|> Map.put("summary", "")
|
||||||
|
end
|
||||||
|
|
||||||
|
def fix_summary(%{"summary" => _} = object) do
|
||||||
|
# summary is present, nothing to do
|
||||||
|
object
|
||||||
|
end
|
||||||
|
|
||||||
|
def fix_summary(object) do
|
||||||
|
object
|
||||||
|
|> Map.put("summary", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_addressing_list(map, field) do
|
def fix_addressing_list(map, field) do
|
||||||
|
Loading…
Reference in New Issue
Block a user