diff options
author | Roman Chvanikov <chvanikoff@gmail.com> | 2019-05-29 18:18:22 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@gmail.com> | 2019-05-29 18:18:22 +0300 |
commit | ce47017c8927b8b2d31668d5e32e387d80739502 (patch) | |
tree | be77acd4dc0c6b9d7b6cb8515470e1dae3212aa7 /lib/pleroma/web/common_api/utils.ex | |
parent | f1f7a11222f4689f000825147d16b366d915f393 (diff) | |
parent | 57e58d26029388a5831cd2ac3fbc419c27c4d7c6 (diff) | |
download | pleroma-ce47017c8927b8b2d31668d5e32e387d80739502.tar.gz |
Merge develop
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 1dfe50b40..d93c0d46e 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -223,7 +223,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do in_reply_to, tags, cw \\ nil, - cc \\ [] + cc \\ [], + sensitive \\ false ) do object = %{ "type" => "Note", @@ -231,19 +232,18 @@ defmodule Pleroma.Web.CommonAPI.Utils do "cc" => cc, "content" => content_html, "summary" => cw, + "sensitive" => !Enum.member?(["false", "False", "0", false], sensitive), "context" => context, "attachment" => attachments, "actor" => actor, "tag" => tags |> Enum.map(fn {_, tag} -> tag end) |> Enum.uniq() } - if in_reply_to do - in_reply_to_object = Object.normalize(in_reply_to) - - object - |> Map.put("inReplyTo", in_reply_to_object.data["id"]) + with false <- is_nil(in_reply_to), + %Object{} = in_reply_to_object <- Object.normalize(in_reply_to) do + Map.put(object, "inReplyTo", in_reply_to_object.data["id"]) else - object + _ -> object end end |