diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-17 19:57:14 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-17 19:57:14 +0700 |
commit | 557f0e33a7de7ef89c72441ffc3a9c09c56fe9a7 (patch) | |
tree | 8044adbc3645ccd1c7dce13b396e7d23db51a0fb /lib/pleroma/web/common_api/utils.ex | |
parent | f2936e0a0723956c167a06dc51518da172a508b2 (diff) | |
parent | e5b34f5e0544371603bc2b570c26ede3182c2f8b (diff) | |
download | pleroma-557f0e33a7de7ef89c72441ffc3a9c09c56fe9a7.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into feature/addressable-lists
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index ba6ed67ef..a463c1f98 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -246,13 +246,11 @@ defmodule Pleroma.Web.CommonAPI.Utils do "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 |