- def skip?(
- :non_followers,
- %Activity{} = activity,
- %User{notification_settings: %{non_followers: false}} = user
- ) do
- actor = activity.data["actor"]
- follower = User.get_cached_by_ap_id(actor)
- !User.following?(follower, user)
- end
-
- def skip?(
- :follows,
- %Activity{} = activity,
- %User{notification_settings: %{follows: false}} = user
- ) do
- actor = activity.data["actor"]
- followed = User.get_cached_by_ap_id(actor)
- User.following?(user, followed)
+ cond do
+ opts[:type] == "poll" -> false
+ user.ap_id == actor -> false
+ !User.following?(follower, user) -> true
+ true -> false
+ end