diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-07-18 11:03:56 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-07-18 11:10:23 -0500 |
commit | 70f1496eb861650d16310205cef1957fcd201948 (patch) | |
tree | 6d0a63f6bd311bdfdfcf30fe67aeed95a271b2cc /lib | |
parent | 0b1c05ca1e387d4a929dce3cac7214fdaf1c2444 (diff) | |
download | pleroma-70f1496eb861650d16310205cef1957fcd201948.tar.gz pleroma-70f1496eb861650d16310205cef1957fcd201948.zip |
Poll notification: only notify local users
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/notification.ex | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 4a6e5d3f9..32f13df69 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) |