X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fnotification.ex;h=3995be01f7a2d8d217704c99e32d921108aa8883;hb=0c2c057c75e21ec411599016b705801f98565cf8;hp=593448713a59ff6e7aeb1a2f48c75243991ecbce;hpb=2641dcdd15791cdee908fd167309a646c1742e31;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 593448713..3995be01f 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -138,7 +138,24 @@ defmodule Pleroma.Notification do query |> where([n, a], a.actor not in ^blocked_ap_ids) - |> FollowingRelationship.keep_following_or_not_domain_blocked(user) + |> restrict_domain_blocked(user) + end + + defp restrict_domain_blocked(query, user) do + where( + query, + [_, activity], + fragment( + # "(actor's domain NOT in domain_blocks)" + """ + NOT ( + substring(? from '.*://([^/]*)') = ANY(?) + ) + """, + activity.actor, + ^user.domain_blocks + ) + ) end defp exclude_blockers(query, user) do