Represent object publishing date in notes.

This commit is contained in:
Roger Braun 2017-06-02 22:47:49 +02:00
parent 24a3cd5d76
commit cdcb201bf5
2 changed files with 6 additions and 6 deletions

View file

@ -28,8 +28,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, with_author) do def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, with_author) do
h = fn(str) -> [to_charlist(str)] end h = fn(str) -> [to_charlist(str)] end
updated_at = activity.data["published"] updated_at = activity.data["object"]["published"]
inserted_at = activity.data["published"] inserted_at = activity.data["object"]["published"]
attachments = Enum.map(activity.data["object"]["attachment"] || [], fn(attachment) -> attachments = Enum.map(activity.data["object"]["attachment"] || [], fn(attachment) ->
url = hd(attachment["url"]) url = hd(attachment["url"])

View file

@ -18,8 +18,8 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
<id>#{note_activity.data["object"]["id"]}</id> <id>#{note_activity.data["object"]["id"]}</id>
<title>New note by #{user.nickname}</title> <title>New note by #{user.nickname}</title>
<content type="html">#{note_activity.data["object"]["content"]}</content> <content type="html">#{note_activity.data["object"]["content"]}</content>
<published>#{note_activity.data["published"]}</published> <published>#{note_activity.data["object"]["published"]}</published>
<updated>#{note_activity.data["published"]}</updated> <updated>#{note_activity.data["object"]["published"]}</updated>
<ostatus:conversation>#{note_activity.data["context"]}</ostatus:conversation> <ostatus:conversation>#{note_activity.data["context"]}</ostatus:conversation>
<link ref="#{note_activity.data["context"]}" rel="ostatus:conversation" /> <link ref="#{note_activity.data["context"]}" rel="ostatus:conversation" />
<link type="application/atom+xml" href="#{note_activity.data["object"]["id"]}" rel="self" /> <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> <id>#{answer.data["object"]["id"]}</id>
<title>New note by #{user.nickname}</title> <title>New note by #{user.nickname}</title>
<content type="html">#{answer.data["object"]["content"]}</content> <content type="html">#{answer.data["object"]["content"]}</content>
<published>#{answer.data["published"]}</published> <published>#{answer.data["object"]["published"]}</published>
<updated>#{answer.data["published"]}</updated> <updated>#{answer.data["object"]["published"]}</updated>
<ostatus:conversation>#{answer.data["context"]}</ostatus:conversation> <ostatus:conversation>#{answer.data["context"]}</ostatus:conversation>
<link ref="#{answer.data["context"]}" rel="ostatus:conversation" /> <link ref="#{answer.data["context"]}" rel="ostatus:conversation" />
<link type="application/atom+xml" href="#{answer.data["object"]["id"]}" rel="self" /> <link type="application/atom+xml" href="#{answer.data["object"]["id"]}" rel="self" />