adding destroy multiple for mastofe

This commit is contained in:
Alexander Strizhakov 2019-04-12 02:28:46 +00:00 committed by kaniini
commit 711ade961e
4 changed files with 67 additions and 2 deletions

View file

@ -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?(