Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
[akkoma] / lib / pleroma / notification.ex
index 941218eea1368abd81d41d8c4c8ad35cb50b6dc6..585157efece020946674f764f1adf9d49264b907 100644 (file)
@@ -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?(