projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Feature/896 toggling confirmation
[akkoma]
/
lib
/
pleroma
/
notification.ex
diff --git
a/lib/pleroma/notification.ex
b/lib/pleroma/notification.ex
index 7de2d4c189b47633fffd97aac4fd553f77b6f959..8442643072cf5c9bc56bda9d0ce2d0116643b576 100644
(file)
--- a/
lib/pleroma/notification.ex
+++ b/
lib/pleroma/notification.ex
@@
-36,7
+36,7
@@
defmodule Pleroma.Notification do
|> where(
[n, a],
fragment(
|> where(
[n, a],
fragment(
- "? not in (SELECT ap_id FROM users WHERE info->'d
isabl
ed' @> 'true')",
+ "? not in (SELECT ap_id FROM users WHERE info->'d
eactivat
ed' @> 'true')",
a.actor
)
)
a.actor
)
)
@@
-105,6
+105,14
@@
defmodule Pleroma.Notification do
|> Repo.delete_all()
end
|> 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)
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"]
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?(
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"]
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
User.following?(user, followed)
end