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 13:01:05 +0000 (13:01 +0000)
CHANGELOG.md
lib/pleroma/web/activity_pub/activity_pub.ex

index a86bf0d9676e8c07e91107542672767ca86f59df..52d127b625d28a39d85cb9b67d06f8673ea901ec 100644 (file)
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 
+## [1.0.92] - 2019-10-??
+### Fixed
+- Mastodon API: `exclude_replies` is correctly handled again.
+
 ## [1.0.91] - 2019-10-06
 ### Added
 - Reverse Proxy: Do not retry failed requests to limit pressure on the peer
index 58b002d3c23ec40753681c774c1b4cd334d96a28..984f85cc6130647b0670f22350fecda946f26d5d 100644 (file)
@@ -748,8 +748,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