Skip to content

Commit

Permalink
deliver public post with hashtag to all hashtag followers
Browse files Browse the repository at this point in the history
  • Loading branch information
alphatownsman committed May 24, 2024
1 parent d0ed355 commit 0c991d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions activities/models/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,12 @@ def get_targets(self) -> Iterable[Identity]:
# deliver edit to all previously interacted to this post
for interaction in self.interactions.all():
targets.add(interaction.identity)
# deliver to all hashtag followers
if self.hashtags:
for follow in HashtagFollow.objects.by_hashtags(
self.hashtags
).prefetch_related("identity"):
targets.add(follow.identity)
if self.visibility == Post.Visibilities.public and self.hashtags:
# deliver public post with hashtag to all hashtag followers
for follow in HashtagFollow.objects.by_hashtags(
self.hashtags
).prefetch_related("identity"):
targets.add(follow.identity)
# Then, if it's not mentions only, also deliver to followers
if self.visibility != Post.Visibilities.mentioned:
for follower in self.author.inbound_follows.filter(
Expand Down

0 comments on commit 0c991d1

Please sign in to comment.