aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/notification.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/notification.ex')
-rw-r--r--lib/pleroma/notification.ex29
1 files changed, 9 insertions, 20 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 9ee9606be..9d09cf082 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -550,10 +550,9 @@ defmodule Pleroma.Notification do
[
:self,
:invisible,
- :followers,
- :follows,
- :non_followers,
- :non_follows,
+ :from_followers,
+ :from_following,
+ :from_strangers,
:recently_followed
]
|> Enum.find(&skip?(&1, activity, user))
@@ -573,9 +572,9 @@ defmodule Pleroma.Notification do
end
def skip?(
- :followers,
+ :from_followers,
%Activity{} = activity,
- %User{notification_settings: %{followers: false}} = user
+ %User{notification_settings: %{from_followers: false}} = user
) do
actor = activity.data["actor"]
follower = User.get_cached_by_ap_id(actor)
@@ -583,9 +582,9 @@ defmodule Pleroma.Notification do
end
def skip?(
- :non_followers,
+ :from_strangers,
%Activity{} = activity,
- %User{notification_settings: %{non_followers: false}} = user
+ %User{notification_settings: %{from_strangers: false}} = user
) do
actor = activity.data["actor"]
follower = User.get_cached_by_ap_id(actor)
@@ -593,25 +592,15 @@ defmodule Pleroma.Notification do
end
def skip?(
- :follows,
+ :from_following,
%Activity{} = activity,
- %User{notification_settings: %{follows: false}} = user
+ %User{notification_settings: %{from_following: false}} = user
) do
actor = activity.data["actor"]
followed = User.get_cached_by_ap_id(actor)
User.following?(user, followed)
end
- def skip?(
- :non_follows,
- %Activity{} = activity,
- %User{notification_settings: %{non_follows: false}} = user
- ) do
- actor = activity.data["actor"]
- followed = User.get_cached_by_ap_id(actor)
- !User.following?(user, followed)
- end
-
# To do: consider defining recency in hours and checking FollowingRelationship with a single SQL
def skip?(:recently_followed, %Activity{data: %{"type" => "Follow"}} = activity, %User{} = user) do
actor = activity.data["actor"]