X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fnotification.ex;h=1970fbf65d1611ac907fdeaa78aa6f660404e5d2;hb=593c0851d9a62977f5a6abd22df991b0d73da657;hp=dd7a1c82405f6e8e8ed5fd926bfeb2d2e5a494b5;hpb=31c89acd00396f95a35ea325ed848ffeb2826017;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index dd7a1c824..1970fbf65 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2021 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Notification do @@ -115,7 +115,7 @@ defmodule Pleroma.Notification do |> where( [n, a], fragment( - "? not in (SELECT ap_id FROM users WHERE deactivated = 'true')", + "? not in (SELECT ap_id FROM users WHERE is_active = 'false')", a.actor ) ) @@ -358,7 +358,7 @@ defmodule Pleroma.Notification do def create_notifications(activity, options \\ []) def create_notifications(%Activity{data: %{"to" => _, "type" => "Create"}} = activity, options) do - object = Object.normalize(activity, false) + object = Object.normalize(activity, fetch: false) if object && object.data["type"] == "Answer" do {:ok, []} @@ -507,8 +507,8 @@ defmodule Pleroma.Notification do [object_id] end - def get_potential_receiver_ap_ids(%{data: %{"type" => "Flag"}}) do - User.all_superusers() |> Enum.map(fn user -> user.ap_id end) + def get_potential_receiver_ap_ids(%{data: %{"type" => "Flag", "actor" => actor}}) do + (User.all_superusers() |> Enum.map(fn user -> user.ap_id end)) -- [actor] end def get_potential_receiver_ap_ids(activity) do @@ -625,7 +625,7 @@ defmodule Pleroma.Notification do def skip?(:filtered, %{data: %{"type" => type}}, _) when type in ["Follow", "Move"], do: false def skip?(:filtered, activity, user) do - object = Object.normalize(activity) + object = Object.normalize(activity, fetch: false) cond do is_nil(object) ->