aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-06-02 22:47:49 +0200
committerRoger Braun <roger@rogerbraun.net>2017-06-02 22:47:49 +0200
commitcdcb201bf5d146967f84df9bcf6eff97b0cb575a (patch)
tree09c800bc1f18f88792d4c8749bfe4a6da9920ef6
parent24a3cd5d7687e1749da01506e2681a8318623457 (diff)
downloadpleroma-cdcb201bf5d146967f84df9bcf6eff97b0cb575a.tar.gz
Represent object publishing date in notes.
-rw-r--r--lib/pleroma/web/ostatus/activity_representer.ex4
-rw-r--r--test/web/ostatus/activity_representer_test.exs8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/pleroma/web/ostatus/activity_representer.ex b/lib/pleroma/web/ostatus/activity_representer.ex
index e91ff0769..eaa3c65e9 100644
--- a/lib/pleroma/web/ostatus/activity_representer.ex
+++ b/lib/pleroma/web/ostatus/activity_representer.ex
@@ -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"])
diff --git a/test/web/ostatus/activity_representer_test.exs b/test/web/ostatus/activity_representer_test.exs
index ec75fc765..b9fa4ccfb 100644
--- a/test/web/ostatus/activity_representer_test.exs
+++ b/test/web/ostatus/activity_representer_test.exs
@@ -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" />