aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-04-21 04:22:02 +0200
committerRoger Braun <roger@rogerbraun.net>2017-04-21 04:22:02 +0200
commitf51a672ac43696424034107c4f397e2b6b01d623 (patch)
treedf6a8a7551be2088d24740a4c456b7b1582565fa
parent424e0e77792361d8f43a085c7cd3b2e9d566a22d (diff)
downloadpleroma-f51a672ac43696424034107c4f397e2b6b01d623.tar.gz
Return object id in Ostatus create activties.
-rw-r--r--lib/pleroma/web/ostatus/activity_representer.ex4
-rw-r--r--test/web/ostatus/activity_representer_test.exs2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/ostatus/activity_representer.ex b/lib/pleroma/web/ostatus/activity_representer.ex
index 558c85df4..6f101109c 100644
--- a/lib/pleroma/web/ostatus/activity_representer.ex
+++ b/lib/pleroma/web/ostatus/activity_representer.ex
@@ -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)},
diff --git a/test/web/ostatus/activity_representer_test.exs b/test/web/ostatus/activity_representer_test.exs
index 16a9d3b00..de79717b1 100644
--- a/test/web/ostatus/activity_representer_test.exs
+++ b/test/web/ostatus/activity_representer_test.exs
@@ -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>