diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2019-04-12 02:28:46 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-04-12 02:28:46 +0000 |
commit | 711ade961e43daaf7dc89aa6fd6da1faffc152ff (patch) | |
tree | 0466472c90a80bb14dc07a5e6a1a14d6827a4a00 /lib/pleroma/notification.ex | |
parent | 9825a943917321204d26ca1b486491138c8c82da (diff) | |
download | pleroma-711ade961e43daaf7dc89aa6fd6da1faffc152ff.tar.gz |
adding destroy multiple for mastofe
Diffstat (limited to 'lib/pleroma/notification.ex')
-rw-r--r-- | lib/pleroma/notification.ex | 11 |
1 files changed, 9 insertions, 2 deletions
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?( |