Keep ostatus id as activity id.
authorRoger Braun <roger@rogerbraun.net>
Sun, 30 Apr 2017 07:25:46 +0000 (09:25 +0200)
committerRoger Braun <roger@rogerbraun.net>
Sun, 30 Apr 2017 07:25:46 +0000 (09:25 +0200)
lib/pleroma/web/ostatus/ostatus.ex
test/web/ostatus/ostatus_test.exs

index 9f85d971a621dda73aeafd86bce60634d6be1e2f..f8e33bc7e220aa27d6026596a28bb977c4b746b9 100644 (file)
@@ -63,6 +63,7 @@ defmodule Pleroma.Web.OStatus do
     to = to ++ mentions
 
     date = string_from_xpath("/entry/published", entry)
+    id = string_from_xpath("/entry/id", entry)
 
     object = %{
       "type" => "Note",
@@ -81,7 +82,7 @@ defmodule Pleroma.Web.OStatus do
       object
     end
 
-    ActivityPub.create(to, actor, context, object, %{}, date)
+    ActivityPub.create(to, actor, context, object, %{"id" => id}, date)
   end
 
   def find_or_make_user(uri) do
index 1e747c728a76833ad4b14ea588dc049ae0fc6911..a53e0ebdeb07662cb6c6f36e995c59820f14656c 100644 (file)
@@ -7,6 +7,7 @@ defmodule Pleroma.Web.OStatusTest do
     {:ok, [activity]} = OStatus.handle_incoming(incoming)
 
     assert activity.data["type"] == "Create"
+    assert activity.data["id"] == "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note"
     assert activity.data["object"]["type"] == "Note"
     assert activity.data["published"] == "2017-04-23T14:51:03+00:00"
     assert activity.data["context"] == "tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b"