From: rinpatch Date: Sun, 8 Dec 2019 13:07:05 +0000 (+0000) Subject: Merge branch 'improve-move-notificaions-api' into 'develop' X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8404f8c8fbc4a60473df0977bc05e2587207d811;p=akkoma Merge branch 'improve-move-notificaions-api' into 'develop' Add `with_move` query param to the notifications API See merge request pleroma/pleroma!2032 --- 8404f8c8fbc4a60473df0977bc05e2587207d811 diff --cc lib/pleroma/notification.ex index 43719b962,6b6e1c2e1..71423ce5e --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@@ -74,16 -54,15 +74,17 @@@ defmodule Pleroma.Notification d ) ) |> 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