Merge branch 'fix/reports-from-admins' into 'develop'
[akkoma] / lib / pleroma / notification.ex
index 4efea9f7dafb62037c818cf8692f53446dba1943..1970fbf65d1611ac907fdeaa78aa6f660404e5d2 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # 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
       )
     )
@@ -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