Merge branch 'develop' into test/activity_pub/transmogrifier.ex
authorMaksim Pechnikov <parallel588@gmail.com>
Fri, 13 Sep 2019 03:55:05 +0000 (06:55 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Fri, 13 Sep 2019 03:55:05 +0000 (06:55 +0300)
1  2 
lib/pleroma/web/activity_pub/transmogrifier.ex
test/web/activity_pub/transmogrifier_test.exs

index 9f699de9e92c10f2c1af27605cd018aeed5d0299,350b83abb3d245f5a08be850af46db9ca55188fd..5b8e7f8f15d8568fad5ca587dc6735e37fd6ad2c
@@@ -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