X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fnotification.ex;h=2ab09495d0609b0ae091d38174a1eeca3eefdcb2;hb=5e02658e55c42913790bde10baf318ad707a32eb;hp=9e0ce0329e2638652eded2a150d4fc1087c9d013;hpb=bd853199d93e03fedf43397455939c6d633fa36b;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 9e0ce0329..2ab09495d 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -341,6 +341,14 @@ defmodule Pleroma.Notification do |> Repo.delete_all() end + def destroy_multiple_from_types(%{id: user_id}, types) do + from(n in Notification, + where: n.user_id == ^user_id, + where: n.type in ^types + ) + |> Repo.delete_all() + end + def dismiss(%Pleroma.Activity{} = activity) do Notification |> where([n], n.activity_id == ^activity.id)