common api: utils: access inReplyTo object ID correctly
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 25 Nov 2018 19:00:05 +0000 (19:00 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Tue, 4 Dec 2018 04:52:09 +0000 (04:52 +0000)
lib/pleroma/web/common_api/utils.ex

index 728f24c7e746290904c58d14c3a4878113beebef..ec66452c23eef3e4d521a9aac8c24cbf6060d809 100644 (file)
@@ -177,8 +177,10 @@ defmodule Pleroma.Web.CommonAPI.Utils do
     }
 
     if inReplyTo do
+      inReplyToObject = Object.normalize(inReplyTo.data["object"])
+
       object
-      |> Map.put("inReplyTo", inReplyTo.data["object"]["id"])
+      |> Map.put("inReplyTo", inReplyToObject.data["id"])
       |> Map.put("inReplyToStatusId", inReplyTo.id)
     else
       object