Handle users without shared_inbox in broadcast

This commit is contained in:
Mouse Reeve 2020-02-14 22:15:14 -08:00
parent 6df9700604
commit a0323ead33

View file

@ -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