Merge branch 'feature/broken-thread-filtering' into 'develop'
[akkoma] / lib / pleroma / web / mastodon_api / mastodon_api_controller.ex
index 77146d780b32934eadc30ca3e2dbcbcf9a2a4aee..bc7558cb8696210c877a00219c4fdd0a1f3b504a 100644 (file)
@@ -223,6 +223,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
 
     activities =
       ActivityPub.fetch_activities([user.ap_id | user.following], params)
+      |> ActivityPub.contain_timeline(user)
       |> Enum.reverse()
 
     conn
@@ -1215,4 +1216,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
       res
     end
   end
+
+  def try_render(conn, _, _, _) do
+    conn
+    |> put_status(501)
+    |> json(%{error: "Can't display this activity"})
+  end
 end