X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fnotification.ex;h=585157efece020946674f764f1adf9d49264b907;hb=e8c2f9a73a37636a9a8ed5c2998617b841f482da;hp=941218eea1368abd81d41d8c4c8ad35cb50b6dc6;hpb=38926a063a39c4d4387049f5d364f72a9f8bd2de;p=akkoma 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?(