From: Haelwenn (lanodan) Monnier Date: Fri, 21 Sep 2018 10:43:35 +0000 (+0200) Subject: [Pleroma.Web.ActivityPub.Transmogrifier]: Fix when inReplyTo is a inlined post [kroeg] X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=a4abb124eab7a03d8670c545cdbe029baad1c5f1;p=akkoma [Pleroma.Web.ActivityPub.Transmogrifier]: Fix when inReplyTo is a inlined post [kroeg] --- diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 48c3aec97..3af3efbb3 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -96,8 +96,17 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do object end - def fix_in_reply_to(%{"inReplyTo" => in_reply_to_id} = object) - when not is_nil(in_reply_to_id) do + def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object) + when not is_nil(in_reply_to) do + in_reply_to_id = + if is_bitstring(in_reply_to) do + in_reply_to + else + if is_map(in_reply_to) && in_reply_to["id"] do + in_reply_to["id"] + end + end + case ActivityPub.fetch_object_from_id(in_reply_to_id) do {:ok, replied_object} -> with %Activity{} = activity <-