X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fnotification.ex;h=b357d5399d024cc0968acc5b8719206a2306184c;hb=b09ae02c04d66e58c2bcc6ce10277c88d5fed576;hp=15789907a0071a716b037170603fe2221b5c4fee;hpb=be8350baa2f8c9cf9be3f53ee4a0041dada1386f;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 15789907a..b357d5399 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -98,6 +98,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) @@ -173,8 +181,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?(