aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/notification.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-11-19 23:22:10 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-11-19 23:22:10 +0300
commitba5cc3016514080b4bf7eaefd3e25936c0e222ba (patch)
tree799e826ee738487fcf758fd966cff263f8b491db /lib/pleroma/notification.ex
parent3aaf3aa2c24c6b38d7e49e4861c1294c285db49b (diff)
downloadpleroma-ba5cc3016514080b4bf7eaefd3e25936c0e222ba.tar.gz
[#1335] Implemented notification mutes and reblog mutes as UserRelationships. User to UserRelationship relations and functions refactoring.
Diffstat (limited to 'lib/pleroma/notification.ex')
-rw-r--r--lib/pleroma/notification.ex6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 82faef85e..15b3337f4 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -60,7 +60,7 @@ defmodule Pleroma.Notification do
end
defp exclude_blocked(query, user) do
- blocked_ap_ids = User.blocked_ap_ids(user)
+ blocked_ap_ids = User.blocked_users_ap_ids(user)
query
|> where([n, a], a.actor not in ^blocked_ap_ids)
@@ -75,8 +75,10 @@ defmodule Pleroma.Notification do
end
defp exclude_muted(query, user, _opts) do
+ notification_muted_ap_ids = User.notification_muted_users_ap_ids(user)
+
query
- |> where([n, a], a.actor not in ^user.muted_notifications)
+ |> where([n, a], a.actor not in ^notification_muted_ap_ids)
|> join(:left, [n, a], tm in Pleroma.ThreadMute,
on: tm.user_id == ^user.id and tm.context == fragment("?->>'context'", a.data)
)