projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0114754
)
Poll notification: notify for polls even when block_from_strangers is set
author
Alex Gleason
<alex@alexgleason.me>
Sun, 18 Jul 2021 15:48:37 +0000
(10:48 -0500)
committer
Alex Gleason
<alex@alexgleason.me>
Sun, 18 Jul 2021 16:10:04 +0000
(11:10 -0500)
lib/pleroma/notification.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/notification.ex
b/lib/pleroma/notification.ex
index 43a0e8f49aaac708e64d102e495cc6225bbac0e1..4a6e5d3f931c58b67dbcfcdd80a2cb18203243ba 100644
(file)
--- 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,
: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)
) 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
end
# To do: consider defining recency in hours and checking FollowingRelationship with a single SQL