Browse Source

Return object id in Ostatus create activties.

tags/v0.9.9
Roger Braun 7 years ago
parent
commit
f51a672ac4
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      lib/pleroma/web/ostatus/activity_representer.ex
  2. +1
    -1
      test/web/ostatus/activity_representer_test.exs

+ 2
- 2
lib/pleroma/web/ostatus/activity_representer.ex View File

@@ -1,5 +1,5 @@
defmodule Pleroma.Web.OStatus.ActivityRepresenter do
def to_simple_form(activity, user) do
def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user) do
h = fn(str) -> [to_charlist(str)] end

updated_at = activity.updated_at
@@ -10,7 +10,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
[
{:"activity:object-type", ['http://activitystrea.ms/schema/1.0/note']},
{:"activity:verb", ['http://activitystrea.ms/schema/1.0/post']},
{:id, h.(activity.data["id"])},
{:id, h.(activity.data["object"]["id"])},
{:title, ['New note by #{user.nickname}']},
{:content, [type: 'html'], h.(activity.data["object"]["content"])},
{:published, h.(inserted_at)},


+ 1
- 1
test/web/ostatus/activity_representer_test.exs View File

@@ -18,7 +18,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenterTest do
expected = """
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<id>#{note_activity.data["id"]}</id>
<id>#{note_activity.data["object"]["id"]}</id>
<title>New note by #{user.nickname}</title>
<content type="html">#{note_activity.data["object"]["content"]}</content>
<published>#{inserted_at}</published>


Loading…
Cancel
Save