)
)
|> preload([n, a, o], activity: {a, object: o})
- |> exclude_muted(user, opts)
- |> exclude_blocked(user)
+ |> exclude_notification_muted(user, exclude_notification_muted_opts)
+ |> exclude_blocked(user, exclude_blocked_opts)
|> exclude_visibility(opts)
+ |> exclude_move(opts)
end
- defp exclude_blocked(query, user) do
+ defp exclude_blocked(query, user, opts) do
+ blocked_ap_ids = opts[:blocked_users_ap_ids] || User.blocked_users_ap_ids(user)
+
query
- |> where([n, a], a.actor not in ^user.blocks)
+ |> where([n, a], a.actor not in ^blocked_ap_ids)
|> where(
[n, a],
fragment("substring(? from '.*://([^/]*)')", a.actor) not in ^user.domain_blocks