From 1e7bb69a957c279eb75ed72cca779caa9d8f25ce Mon Sep 17 00:00:00 2001 From: Maksim Pechnikov Date: Tue, 4 Jun 2019 15:20:24 +0300 Subject: [PATCH] update ActivityPub#fetch_activities_query --- lib/pleroma/web/activity_pub/activity_pub.ex | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index eefed5832..c0e3d1478 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -575,6 +575,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do defp restrict_thread_visibility(query, _, %{skip_thread_containment: true} = _), do: query + defp restrict_thread_visibility( + query, + %{"user" => %User{info: %{skip_thread_containment: true}}}, + _ + ), + do: query + defp restrict_thread_visibility(query, %{"user" => %User{ap_id: ap_id}}, _) do from( a in query, @@ -860,7 +867,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do def fetch_activities_query(recipients, opts \\ %{}) do base_query = from(activity in Activity) - config = Enum.into(Config.get([:instance]), %{}) + + config = %{ + skip_thread_containment: Config.get([:instance, :skip_thread_containment]) + } base_query |> maybe_preload_objects(opts) -- 2.45.2