From ed8dfa3029da8e6b20fca66d51c96c87e5eedbd9 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 26 Sep 2018 18:47:18 +0000 Subject: [PATCH] transmogrifier: reformat `cond` block by hand --- lib/pleroma/web/activity_pub/transmogrifier.ex | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 704c76f70..868e773c4 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -100,11 +100,18 @@ def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object) when not is_nil(in_reply_to) do in_reply_to_id = cond do - is_bitstring(in_reply_to) -> in_reply_to - is_map(in_reply_to) && is_bitstring(in_reply_to["id"]) -> in_reply_to["id"] - is_list(in_reply_to) && is_bitstring(Enum.at(in_reply_to, 0)) -> Enum.at(in_reply_to, 0) + is_bitstring(in_reply_to) -> + in_reply_to + + is_map(in_reply_to) && is_bitstring(in_reply_to["id"]) -> + in_reply_to["id"] + + is_list(in_reply_to) && is_bitstring(Enum.at(in_reply_to, 0)) -> + Enum.at(in_reply_to, 0) + # Maybe I should output an error too? - true -> "" + true -> + "" end case ActivityPub.fetch_object_from_id(in_reply_to_id) do