From cdcb201bf5d146967f84df9bcf6eff97b0cb575a Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 2 Jun 2017 22:47:49 +0200 Subject: [PATCH] Represent object publishing date in notes. --- lib/pleroma/web/ostatus/activity_representer.ex | 4 ++-- test/web/ostatus/activity_representer_test.exs | 8 ++++---- 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 #{note_activity.data["object"]["id"]} New note by #{user.nickname} #{note_activity.data["object"]["content"]} - #{note_activity.data["published"]} - #{note_activity.data["published"]} + #{note_activity.data["object"]["published"]} + #{note_activity.data["object"]["published"]} #{note_activity.data["context"]} @@ -51,8 +51,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do #{answer.data["object"]["id"]} New note by #{user.nickname} #{answer.data["object"]["content"]} - #{answer.data["published"]} - #{answer.data["published"]} + #{answer.data["object"]["published"]} + #{answer.data["object"]["published"]} #{answer.data["context"]}