projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Conversations: Add mix task to 'import' old DMs.
[akkoma]
/
lib
/
pleroma
/
notification.ex
diff --git
a/lib/pleroma/notification.ex
b/lib/pleroma/notification.ex
index 15789907a0071a716b037170603fe2221b5c4fee..dd274cf6b22b8bdb2412b79d759f1bd7189e2239 100644
(file)
--- a/
lib/pleroma/notification.ex
+++ b/
lib/pleroma/notification.ex
@@
-98,6
+98,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)
@@
-173,8
+181,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?(
@@
-189,7
+196,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