From a4abb124eab7a03d8670c545cdbe029baad1c5f1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 21 Sep 2018 12:43:35 +0200 Subject: [PATCH] [Pleroma.Web.ActivityPub.Transmogrifier]: Fix when inReplyTo is a inlined post [kroeg] --- lib/pleroma/web/activity_pub/transmogrifier.ex | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 <- -- 2.45.2