X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fnotification.ex;h=8442643072cf5c9bc56bda9d0ce2d0116643b576;hb=5e2b491276d5cd8d90fddf219f7653d1c9b31ef3;hp=b357d5399d024cc0968acc5b8719206a2306184c;hpb=0a09692c7decdcaa8c15e5f8eaf10d9e7d16a5e5;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index b357d5399..844264307 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -33,6 +33,13 @@ defmodule Pleroma.Notification do def for_user_query(user) do Notification |> where(user_id: ^user.id) + |> where( + [n, a], + fragment( + "? not in (SELECT ap_id FROM users WHERE info->'deactivated' @> 'true')", + a.actor + ) + ) |> join(:inner, [n], activity in assoc(n, :activity)) |> join(:left, [n, a], object in Object, on: @@ -196,7 +203,7 @@ defmodule Pleroma.Notification do def skip?(:follows, activity, %{info: %{notification_settings: %{"follows" => false}}} = user) do actor = activity.data["actor"] - followed = User.get_by_ap_id(actor) + followed = User.get_cached_by_ap_id(actor) User.following?(user, followed) end