diff --git a/bookwyrm/activitystreams.py b/bookwyrm/activitystreams.py index 90404f1c3..f8312f063 100644 --- a/bookwyrm/activitystreams.py +++ b/bookwyrm/activitystreams.py @@ -111,8 +111,15 @@ class ActivityStream(RedisStore): Q(id__in=status.user.blocks.all()) | Q(blocks=status.user) # not blocked ) + # only visible to the poster and mentioned users + if status.privacy == "direct": + audience = audience.filter( + Q(id=status.user.id) # if the user is the post's author + | Q(id__in=status.mention_users.all()) # if the user is mentioned + ) + # don't show replies to statuses the user can't see - if status.reply_parent and status.reply_parent.privacy == "followers": + elif status.reply_parent and status.reply_parent.privacy == "followers": audience = audience.filter( Q(id=status.user.id) # if the user is the post's author | Q(id=status.reply_parent.user.id) # if the user is the OG author @@ -121,12 +128,6 @@ class ActivityStream(RedisStore): ) # if the user is following both authors ).distinct() - # only visible to the poster and mentioned users - elif status.privacy == "direct": - audience = audience.filter( - Q(id=status.user.id) # if the user is the post's author - | Q(id__in=status.mention_users.all()) # if the user is mentioned - ) # only visible to the poster's followers and tagged users elif status.privacy == "followers": audience = audience.filter(