Represent object publishing date in notes.
authorRoger Braun <roger@rogerbraun.net>
Fri, 2 Jun 2017 20:47:49 +0000 (22:47 +0200)
committerRoger Braun <roger@rogerbraun.net>
Fri, 2 Jun 2017 20:47:49 +0000 (22:47 +0200)
lib/pleroma/web/ostatus/activity_representer.ex
test/web/ostatus/activity_representer_test.exs

index e91ff0769290abc28867a02a90141e2bcc7418a7..eaa3c65e9495822a116ff846fd5e26e11a357426 100644 (file)
@@ -28,8 +28,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
   def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, with_author) do
     h = fn(str) -> [to_charlist(str)] end
 
-    updated_at = activity.data["published"]
-    inserted_at = activity.data["published"]
+    updated_at = activity.data["object"]["published"]
+    inserted_at = activity.data["object"]["published"]
 
     attachments = Enum.map(activity.data["object"]["attachment"] || [], fn(attachment) ->
       url = hd(attachment["url"])
index ec75fc7652e9bf44e25474b390e7c4c540b855a5..b9fa4ccfb583fe4226d67cd4e915f2cf2db386ba 100644 (file)
@@ -18,8 +18,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
     <id>#{note_activity.data["object"]["id"]}</id>
     <title>New note by #{user.nickname}</title>
     <content type="html">#{note_activity.data["object"]["content"]}</content>
-    <published>#{note_activity.data["published"]}</published>
-    <updated>#{note_activity.data["published"]}</updated>
+    <published>#{note_activity.data["object"]["published"]}</published>
+    <updated>#{note_activity.data["object"]["published"]}</updated>
     <ostatus:conversation>#{note_activity.data["context"]}</ostatus:conversation>
     <link ref="#{note_activity.data["context"]}" rel="ostatus:conversation" />
     <link type="application/atom+xml" href="#{note_activity.data["object"]["id"]}" rel="self" />
@@ -51,8 +51,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
     <id>#{answer.data["object"]["id"]}</id>
     <title>New note by #{user.nickname}</title>
     <content type="html">#{answer.data["object"]["content"]}</content>
-    <published>#{answer.data["published"]}</published>
-    <updated>#{answer.data["published"]}</updated>
+    <published>#{answer.data["object"]["published"]}</published>
+    <updated>#{answer.data["object"]["published"]}</updated>
     <ostatus:conversation>#{answer.data["context"]}</ostatus:conversation>
     <link ref="#{answer.data["context"]}" rel="ostatus:conversation" />
     <link type="application/atom+xml" href="#{answer.data["object"]["id"]}" rel="self" />