diff options
author | Andrew Godwin | 2022-12-16 20:11:07 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-16 20:11:07 -0700 |
commit | 727b357744ac75707beb2e2ebfca6aa62ad3fd3d (patch) | |
tree | a9fd748144f3bddf457b1eb83abcfd2868a1b76c | |
parent | e5b76c120e27bad7c6e4ec323ffc2e65d7dfb654 (diff) | |
download | takahe-727b357744ac75707beb2e2ebfca6aa62ad3fd3d.tar.gz takahe-727b357744ac75707beb2e2ebfca6aa62ad3fd3d.tar.bz2 takahe-727b357744ac75707beb2e2ebfca6aa62ad3fd3d.zip |
Fan out replies to the original author's followers
Fixes #64
-rw-r--r-- | activities/models/post.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activities/models/post.py b/activities/models/post.py index c32ed55..6847327 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -618,6 +618,13 @@ class Post(StatorModel): reply_post = await self.ain_reply_to_post() if reply_post: targets.add(reply_post.author) + # And if it's a reply to one of our own, we have to re-fan-out to + # the original author's followers + if reply_post.author.local: + async for follower in reply_post.author.inbound_follows.select_related( + "source" + ): + targets.add(follower.source) # If this is a remote post or local-only, filter to only include # local identities if not self.local or self.visibility == Post.Visibilities.local_only: |