aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/notification.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-03-25 13:05:00 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-03-25 13:05:00 +0300
commit3fa3d45dbecafb06fb7eb4f0260f610d4225e0a7 (patch)
tree9e3a6627d747b5ef47a504275ff05de75417ccd5 /lib/pleroma/notification.ex
parent012d428e1ffdd83888f339e4dbaec344202eebe1 (diff)
downloadpleroma-3fa3d45dbecafb06fb7eb4f0260f610d4225e0a7.tar.gz
[#1364] Minor improvements / comments.
Further fixes of incorrect usage of "relations" as a short form of "relationships".
Diffstat (limited to 'lib/pleroma/notification.ex')
-rw-r--r--lib/pleroma/notification.ex12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 63e3e9be9..04ee510b9 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -322,6 +322,8 @@ defmodule Pleroma.Notification do
@doc """
Returns a tuple with 2 elements:
{enabled notification receivers, currently disabled receivers (blocking / [thread] muting)}
+
+ NOTE: might be called for FAKE Activities, see ActivityPub.Utils.get_notified_from_object/1
"""
def get_notified_from_activity(activity, local_only \\ true)
@@ -338,7 +340,7 @@ defmodule Pleroma.Notification do
# Since even subscribers and followers can mute / thread-mute, filtering all above AP IDs
notification_enabled_ap_ids =
potential_receiver_ap_ids
- |> exclude_relation_restricting_ap_ids(activity)
+ |> exclude_relationship_restricted_ap_ids(activity)
|> exclude_thread_muter_ap_ids(activity)
potential_receivers =
@@ -355,10 +357,10 @@ defmodule Pleroma.Notification do
def get_notified_from_activity(_, _local_only), do: {[], []}
@doc "Filters out AP IDs of users basing on their relationships with activity actor user"
- def exclude_relation_restricting_ap_ids([], _activity), do: []
+ def exclude_relationship_restricted_ap_ids([], _activity), do: []
- def exclude_relation_restricting_ap_ids(ap_ids, %Activity{} = activity) do
- relation_restricted_ap_ids =
+ def exclude_relationship_restricted_ap_ids(ap_ids, %Activity{} = activity) do
+ relationship_restricted_ap_ids =
activity
|> Activity.user_actor()
|> User.incoming_relationships_ungrouped_ap_ids([
@@ -366,7 +368,7 @@ defmodule Pleroma.Notification do
:notification_mute
])
- Enum.uniq(ap_ids) -- relation_restricted_ap_ids
+ Enum.uniq(ap_ids) -- relationship_restricted_ap_ids
end
@doc "Filters out AP IDs of users who mute activity thread"