From a0323ead330815a3d95df67159fed3df1b1563e5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 14 Feb 2020 22:15:14 -0800 Subject: [PATCH] Handle users without shared_inbox in broadcast --- fedireads/broadcast.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fedireads/broadcast.py b/fedireads/broadcast.py index f4b219e23..1cd4ca0dd 100644 --- a/fedireads/broadcast.py +++ b/fedireads/broadcast.py @@ -22,9 +22,11 @@ def get_recipients(user, post_privacy, direct_recipients=None): followers = user.followers.all() if post_privacy == 'public': # post to public shared inboxes - shared_inboxes = set(u.shared_inbox for u in followers) + shared_inboxes = set( + u.shared_inbox for u in followers if u.shared_inbox + ) recipients += list(shared_inboxes) - # TODO: not every user has a shared inbox + recipients += [u.inbox for u in followers if not u.shared_inbox] # TODO: direct to anyone who's mentioned if post_privacy == 'followers': # don't send it to the shared inboxes