Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
[akkoma] / lib / pleroma / notification.ex
index 7de2d4c189b47633fffd97aac4fd553f77b6f959..585157efece020946674f764f1adf9d49264b907 100644 (file)
@@ -36,7 +36,7 @@ defmodule Pleroma.Notification do
     |> where(
       [n, a],
       fragment(
-        "? not in (SELECT ap_id FROM users WHERE info->'disabled' @> 'true')",
+        "? not in (SELECT ap_id FROM users WHERE info->'deactivated' @> 'true')",
         a.actor
       )
     )
@@ -105,6 +105,14 @@ defmodule Pleroma.Notification do
     |> Repo.delete_all()
   end
 
+  def destroy_multiple(%{id: user_id} = _user, ids) do
+    from(n in Notification,
+      where: n.id in ^ids,
+      where: n.user_id == ^user_id
+    )
+    |> Repo.delete_all()
+  end
+
   def dismiss(%{id: user_id} = _user, id) do
     notification = Repo.get(Notification, id)
 
@@ -180,8 +188,7 @@ defmodule Pleroma.Notification do
   def skip?(:muted, activity, user) do
     actor = activity.data["actor"]
 
-    User.mutes?(user, %{ap_id: actor}) or
-      CommonAPI.thread_muted?(user, activity)
+    User.mutes?(user, %{ap_id: actor}) or CommonAPI.thread_muted?(user, activity)
   end
 
   def skip?(