Additional timeline query improvements from upstream #291

Merged
floatingghost merged 2 commits from norm/akkoma:timeline-query-improvements into develop 2022-11-20 21:53:24 +00:00
Showing only changes of commit 0022fa7d49 - Show all commits

View file

@ -1251,12 +1251,11 @@ defp exclude_invisible_actors(query, %{type: "Flag"}), do: query
defp exclude_invisible_actors(query, %{invisible_actors: true}), do: query
defp exclude_invisible_actors(query, _opts) do
invisible_ap_ids =
User.Query.build(%{invisible: true, select: [:ap_id]})
|> Repo.all()
|> Enum.map(fn %{ap_id: ap_id} -> ap_id end)
from([activity] in query, where: activity.actor not in ^invisible_ap_ids)
query
|> join(:inner, [activity], u in User,
as: :u,
on: activity.actor == u.ap_id and u.invisible == false
)
end
defp exclude_id(query, %{exclude_id: id}) when is_binary(id) do