aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-04-10 02:10:47 +0000
committerkaniini <nenolod@gmail.com>2019-04-10 02:10:47 +0000
commit0ab563d3341f7cf9bb3e9f85a869499701cbb7d9 (patch)
treeda18ccb6bad423d0ecfa31fd7f74807ca32735ec /lib
parent97395e013e5dac84399769438f8b90cffa38afd5 (diff)
parentcf9ba8fe1b5a701488889c4bfdde46e7f00b9ebc (diff)
downloadpleroma-0ab563d3341f7cf9bb3e9f85a869499701cbb7d9.tar.gz
Merge branch 'hotfix/fix_undefined_summary' into 'develop'
transmogrifier.ex: Add fix_summary/1 See merge request pleroma/pleroma!1039
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/transmogrifier.ex16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex
index 593ae3188..49ea73204 100644
--- a/lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/lib/pleroma/web/activity_pub/transmogrifier.ex
@@ -83,6 +83,22 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|> fix_content_map
|> fix_likes
|> 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
def fix_addressing_list(map, field) do