From d06e0a3312d38e24533aeb90c233f77d7712c11b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 18 Jul 2021 11:03:56 -0500 Subject: Poll notification: only notify local users --- lib/pleroma/notification.ex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 9c7415f29..31544570f 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -471,9 +471,11 @@ defmodule Pleroma.Notification do end notifications = - Enum.map([actor | voters], fn ap_id -> - with %User{} = user <- User.get_by_ap_id(ap_id) do - create_notification(activity, user, type: "poll") + Enum.reduce([actor | voters], [], fn ap_id, acc -> + with %User{local: true} = user <- User.get_by_ap_id(ap_id) do + [create_notification(activity, user, type: "poll") | acc] + else + _ -> acc end end) -- cgit v1.2.3