From: Maksim Pechnikov Date: Fri, 13 Sep 2019 03:55:05 +0000 (+0300) Subject: Merge branch 'develop' into test/activity_pub/transmogrifier.ex X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2b40e57a72f3ee3209b204a5ae5e0221b1d66c7e;p=akkoma Merge branch 'develop' into test/activity_pub/transmogrifier.ex --- 2b40e57a72f3ee3209b204a5ae5e0221b1d66c7e diff --cc lib/pleroma/web/activity_pub/transmogrifier.ex index 9f699de9e,350b83abb..5b8e7f8f1 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@@ -156,16 -174,23 +156,16 @@@ defmodule Pleroma.Web.ActivityPub.Trans object = Map.put(object, "inReplyToAtomUri", in_reply_to_id) if Federator.allowed_incoming_reply_depth?(options[:depth]) do - case get_obj_helper(in_reply_to_id, options) do - {:ok, replied_object} -> - with %Activity{} = _activity <- - Activity.get_create_by_object_ap_id(replied_object.data["id"]) do - object - |> Map.put("inReplyTo", replied_object.data["id"]) - |> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_id) - |> Map.put("conversation", replied_object.data["context"] || object["conversation"]) - |> Map.put("context", replied_object.data["context"] || object["conversation"]) - else - e -> - Logger.error("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}") - object - end - + with {:ok, replied_object} <- get_obj_helper(in_reply_to_id, options), + %Activity{} = _ <- Activity.get_create_by_object_ap_id(replied_object.data["id"]) do + object + |> Map.put("inReplyTo", replied_object.data["id"]) + |> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_id) + |> Map.put("conversation", replied_object.data["context"] || object["conversation"]) + |> Map.put("context", replied_object.data["context"] || object["conversation"]) + else e -> - Logger.error("Couldn't fetch \"#{inspect(in_reply_to_id)}\", error: #{inspect(e)}") + Logger.error("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}") object end else