Just give out the entry, not the whole feed.
authorRoger Braun <roger@rogerbraun.net>
Wed, 3 May 2017 08:01:26 +0000 (10:01 +0200)
committerRoger Braun <roger@rogerbraun.net>
Wed, 3 May 2017 08:02:29 +0000 (10:02 +0200)
lib/pleroma/web/ostatus/ostatus_controller.ex
test/web/ostatus/ostatus_controller_test.exs

index 6a4199846ba596d7833d856176d8f0bcbb0c596e..c6700ae782e9bb00715c0f95a9775efc4eb95b59 100644 (file)
@@ -2,7 +2,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
   use Pleroma.Web, :controller
 
   alias Pleroma.{User, Activity}
-  alias Pleroma.Web.OStatus.FeedRepresenter
+  alias Pleroma.Web.OStatus.{FeedRepresenter, ActivityRepresenter}
   alias Pleroma.Repo
   alias Pleroma.Web.OStatus
   import Ecto.Query
@@ -43,12 +43,12 @@ defmodule Pleroma.Web.OStatus.OStatusController do
   end
 
   def object(conn, %{"uuid" => uuid}) do
-    IO.inspect(uuid)
     id = o_status_url(conn, :object, uuid)
     activity = Activity.get_create_activity_by_object_ap_id(id)
     user = User.get_cached_by_ap_id(activity.data["actor"])
 
-    response = FeedRepresenter.to_simple_form(user, [activity], [user])
+    response = ActivityRepresenter.to_simple_form(activity, user, true)
+    |> ActivityRepresenter.wrap_with_entry
     |> :xmerl.export_simple(:xmerl_xml)
     |> to_string
 
index f076987474f0d89f33392378941402388c65b17f..8b7ca4d8933dcbbe5191ebf6d98672a79a7637a8 100644 (file)
@@ -17,7 +17,6 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do
     note_activity = insert(:note_activity)
     [_, uuid] = hd Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"])
     url = "/objects/#{uuid}"
-    |> IO.inspect
 
     conn = conn
     |> get(url)