diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-04-22 13:08:30 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-04-22 13:08:30 +0700 |
commit | e8c2f9a73a37636a9a8ed5c2998617b841f482da (patch) | |
tree | 4b194e631d2bbb58b8522c3d74a0b0c2ea09fedd /lib/pleroma/notification.ex | |
parent | 38926a063a39c4d4387049f5d364f72a9f8bd2de (diff) | |
parent | 7fcbda702e76b6390076c28832f5aea80086d15a (diff) | |
download | pleroma-e8c2f9a73a37636a9a8ed5c2998617b841f482da.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
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 941218eea..585157efe 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -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?( |