X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fnotification.ex;h=8442643072cf5c9bc56bda9d0ce2d0116643b576;hb=46684db84d0583cb5d88f8fcbd6b970ef95c84de;hp=941218eea1368abd81d41d8c4c8ad35cb50b6dc6;hpb=db4badc6aa71df4cb9372ef4aff699399516ffb2;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 941218eea..844264307 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?( @@ -196,7 +203,7 @@ defmodule Pleroma.Notification do def skip?(:follows, activity, %{info: %{notification_settings: %{"follows" => false}}} = user) do actor = activity.data["actor"] - followed = User.get_by_ap_id(actor) + followed = User.get_cached_by_ap_id(actor) User.following?(user, followed) end