+
+ @spec query_by_actor(actor()) :: Ecto.Query.t()
+ def query_by_actor(actor) do
+ from(a in Activity, where: a.actor == ^actor)
+ end
+
+ def restrict_deactivated_users(query) do
+ deactivated_users =
+ from(u in User.Query.build(deactivated: true), select: u.ap_id)
+ |> Repo.all()
+
+ from(activity in query,
+ where: activity.actor not in ^deactivated_users
+ )
+ end
+
+ defdelegate search(user, query, options \\ []), to: Pleroma.Activity.Search