Save correct date for incoming notes.
authorRoger Braun <roger@rogerbraun.net>
Thu, 8 Jun 2017 14:44:12 +0000 (16:44 +0200)
committerRoger Braun <roger@rogerbraun.net>
Thu, 8 Jun 2017 14:44:12 +0000 (16:44 +0200)
lib/pleroma/web/ostatus/handlers/note_handler.ex
test/web/ostatus/ostatus_test.exs

index cbbe8ba0daa7f96885f0317a283c904c5f02f5ae..0abc0ac5c5cb5751fa6191c25c76cb12b48afd27 100644 (file)
@@ -66,6 +66,7 @@ defmodule Pleroma.Web.OStatus.NoteHandler do
          date <- XML.string_from_xpath("//published", entry),
          note <- TwitterAPI.Utils.make_note_data(actor.ap_id, to, context, content_html, attachments, inReplyToActivity, []),
          note <- note |> Map.put("id", id) |> Map.put("tag", tags),
+         note <- note |> Map.put("published", date),
          # TODO: Handle this case in make_note_data
          note <- (if inReplyTo && !inReplyToActivity, do: note |> Map.put("inReplyTo", inReplyTo), else: note)
       do
index e40fae78cc3a1d22f5386ab7cc6a998b236f0db5..a49d950878266f4192c9d52b0e594956440104f0 100644 (file)
@@ -19,6 +19,7 @@ defmodule Pleroma.Web.OStatusTest do
     assert activity.data["object"]["type"] == "Note"
     assert activity.data["object"]["id"] == "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note"
     assert activity.data["published"] == "2017-04-23T14:51:03+00:00"
+    assert activity.data["object"]["published"] == "2017-04-23T14:51:03+00:00"
     assert activity.data["context"] == "tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b"
     assert "http://pleroma.example.org:4000/users/lain3" in activity.data["to"]
     assert activity.local == false