mastodon api: fix exclude_replies (closes #1287)
authorAriadne Conill <ariadne@dereferenced.org>
Mon, 7 Oct 2019 12:29:33 +0000 (12:29 +0000)
committerAriadne Conill <ariadne@dereferenced.org>
Mon, 7 Oct 2019 12:29:33 +0000 (12:29 +0000)
CHANGELOG.md
lib/pleroma/web/activity_pub/activity_pub.ex

index f193ec1ff30b95e2039f1473cd09effcd37e6942..8b24db7f4b37002a15c4729e6dfaf335ebcd7912 100644 (file)
@@ -85,6 +85,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 - ActivityPub: Fix `/users/:nickname/inbox` crashing without an authenticated user
 - MRF: fix ability to follow a relay when AntiFollowbotPolicy was enabled
 - Mastodon API: Blocks are now treated consistently between the Streaming API and the Timeline APIs
+- Mastodon API: `exclude_replies` is correctly handled again.
 
 ### Added
 - Expiring/ephemeral activites. All activities can have expires_at value set, which controls when they should be deleted automatically.
index 5052d1304116af754381a6ba7da021b3f1edb8c5..9f29087df4438fa26f499c869158f12cedc327eb 100644 (file)
@@ -780,8 +780,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
 
   defp restrict_replies(query, %{"exclude_replies" => val}) when val == "true" or val == "1" do
     from(
-      activity in query,
-      where: fragment("?->'object'->>'inReplyTo' is null", activity.data)
+      [_activity, object] in query,
+      where: fragment("?->>'inReplyTo' is null", object.data)
     )
   end