aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-07-18 10:48:37 -0500
committerAlex Gleason <alex@alexgleason.me>2021-07-18 11:10:04 -0500
commitcbd1a10c16db026fac96fa2ddcb05b4eb106d290 (patch)
tree656266ddab377425d8279b3e5fff3de0a6408abb
parent0114754db2d9dde25b31729644f898f20121de27 (diff)
downloadpleroma-cbd1a10c16db026fac96fa2ddcb05b4eb106d290.tar.gz
Poll notification: notify for polls even when block_from_strangers is set
-rw-r--r--lib/pleroma/notification.ex10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 43a0e8f49..4a6e5d3f9 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -631,11 +631,17 @@ defmodule Pleroma.Notification do
:block_from_strangers,
%Activity{} = activity,
%User{notification_settings: %{block_from_strangers: true}} = user,
- _opts
+ opts
) do
actor = activity.data["actor"]
follower = User.get_cached_by_ap_id(actor)
- !User.following?(follower, user)
+
+ cond do
+ opts[:type] == "poll" -> false
+ user.ap_id == actor -> false
+ !User.following?(follower, user) -> true
+ true -> false
+ end
end
# To do: consider defining recency in hours and checking FollowingRelationship with a single SQL