diff options
author | rinpatch <rinpatch@sdf.org> | 2019-05-23 14:03:16 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-05-23 14:03:16 +0300 |
commit | 8b2d39c1ec8f47df8a2159c23eabdc61b983ddf0 (patch) | |
tree | 9bce9b2e611adb077d8a8e42d3b8b72fd2cac1a4 /lib | |
parent | e6b175ed6cafcd6a05120e003cfe40a04b38849f (diff) | |
download | pleroma-8b2d39c1ec8f47df8a2159c23eabdc61b983ddf0.tar.gz |
Change the order of preloading when fetching activities for context
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index db5a4a7ee..b06200cb5 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -492,7 +492,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do if opts["user"], do: [opts["user"].ap_id | opts["user"].following] ++ public, else: public from(activity in Activity) - |> Activity.with_preloaded_object() + |> maybe_preload_objects(opts) |> exclude_poll_votes(opts) |> restrict_blocked(opts) |> restrict_recipients(recipients, opts["user"]) @@ -513,7 +513,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do def fetch_activities_for_context(context, opts \\ %{}) do context |> fetch_activities_for_context_query(opts) - |> Activity.with_preloaded_object() |> Repo.all() end @@ -521,7 +520,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do Pleroma.FlakeId.t() | nil def fetch_latest_activity_id_for_context(context, opts \\ %{}) do context - |> fetch_activities_for_context_query(opts) + |> fetch_activities_for_context_query(Map.merge(%{"skip_preload" => true}, opts)) |> limit(1) |> select([a], a.id) |> Repo.one() |