Skip to content

Commit

Permalink
Don't fetch interactions with reposts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelOtter committed Sep 11, 2023
1 parent 173e517 commit d12977d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions granary/bluesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,17 +759,20 @@ def get_activities_response(self, user_id=None, group_id=None, app_id=None,
activities = []

for post in posts:
if not include_shares:
reason = post.get('reason')
if reason and reason.get('$type') == 'app.bsky.feed.defs#reasonRepost':
continue
reason = post.get('reason')
is_repost = reason and reason.get('$type') == 'app.bsky.feed.defs#reasonRepost'
if is_repost and not include_shares:
continue

activity = self.postprocess_activity(self._post_to_activity(post))
activities.append(activity)
obj = activity['object']
id = obj.get('id')
tags = obj.setdefault('tags', [])

if is_repost:
# If it's a repost we're not interested in responses to it.
continue
bs_post = post.get('post')
if bs_post and id:
# Likes
Expand Down

0 comments on commit d12977d

Please sign in to comment.