Update object correctly after setting context.
authorRoger Braun <roger@rogerbraun.net>
Fri, 14 Apr 2017 16:59:11 +0000 (18:59 +0200)
committerRoger Braun <roger@rogerbraun.net>
Fri, 14 Apr 2017 16:59:11 +0000 (18:59 +0200)
lib/pleroma/web/twitter_api/twitter_api.ex
test/web/twitter_api/twitter_api_test.exs

index a23f465d41043fd12870990b48606f42623804a2..76dbc77a1a4bff2b92b289a06e3c525d94a8ead5 100644 (file)
@@ -204,6 +204,11 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
       |> put_in(["object", "statusnetConversationId"], activity.id)
       |> put_in(["statusnetConversationId"], activity.id)
 
+      object = Object.get_by_ap_id(activity.data["object"]["id"])
+
+      changeset = Ecto.Changeset.change(object, data: data["object"])
+      Repo.update(changeset)
+
       changeset = Ecto.Changeset.change(activity, data: data)
       Repo.update(changeset)
     end
index 36d4f40122ebeaff3fc4288f09acef6fa12405d0..fd9908b9fd984fb7b4fd1cf09bba36678a8b0061 100644 (file)
@@ -48,6 +48,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
     assert get_in(activity.data, ["statusnetConversationId"]) == activity.id
 
     assert is_list(activity.data["object"]["attachment"])
+
+    assert activity.data["object"] == Object.get_by_ap_id(activity.data["object"]["id"]).data
   end
 
   test "create a status that is a reply" do