From 8a0d2b33d8c9a1cef347c5daf5589a2245eb01b0 Mon Sep 17 00:00:00 2001
From: Roger Braun <roger@rogerbraun.net>
Date: Sun, 30 Apr 2017 09:25:46 +0200
Subject: [PATCH] Keep ostatus id as activity id.

---
 lib/pleroma/web/ostatus/ostatus.ex | 3 ++-
 test/web/ostatus/ostatus_test.exs  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex
index 9f85d971a..f8e33bc7e 100644
--- a/lib/pleroma/web/ostatus/ostatus.ex
+++ b/lib/pleroma/web/ostatus/ostatus.ex
@@ -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
diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs
index 1e747c728..a53e0ebde 100644
--- a/test/web/ostatus/ostatus_test.exs
+++ b/test/web/ostatus/ostatus_test.exs
@@ -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"
-- 
2.49.0