Wire up inReplyToStatusIds for ostatus.
authorRoger Braun <roger@rogerbraun.net>
Thu, 18 May 2017 14:58:30 +0000 (16:58 +0200)
committerRoger Braun <roger@rogerbraun.net>
Thu, 18 May 2017 14:58:30 +0000 (16:58 +0200)
lib/pleroma/web/ostatus/ostatus.ex

index e913e389f47c35afb5745eae44d8d158f74e2c25..a709dac4ea2a6248fc2b3e214736908c8b45c69d 100644 (file)
@@ -196,7 +196,15 @@ defmodule Pleroma.Web.OStatus do
     }
 
     object = if inReplyTo do
-      Map.put(object, "inReplyTo", inReplyTo)
+      replied_to_object = Object.get_cached_by_ap_id(inReplyTo)
+      if replied_to_object do
+        object
+        |> Map.put("inReplyTo", inReplyTo)
+        |> Map.put("inReplyToStatusId", replied_to_object.id)
+      else
+        object
+        |> Map.put("inReplyTo", inReplyTo)
+      end
     else
       object
     end