X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fnotification.ex;h=585157efece020946674f764f1adf9d49264b907;hb=e8c2f9a73a37636a9a8ed5c2998617b841f482da;hp=7de2d4c189b47633fffd97aac4fd553f77b6f959;hpb=0f2f7d2cec8297b1b5645643d7584cde561ce628;p=akkoma diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 7de2d4c18..585157efe 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -36,7 +36,7 @@ defmodule Pleroma.Notification do |> where( [n, a], fragment( - "? not in (SELECT ap_id FROM users WHERE info->'disabled' @> 'true')", + "? not in (SELECT ap_id FROM users WHERE info->'deactivated' @> 'true')", a.actor ) ) @@ -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?(