Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP => Bluesky: don't wait for follow before sending posts #999

Closed
snarfed opened this issue May 3, 2024 · 5 comments
Closed

AP => Bluesky: don't wait for follow before sending posts #999

snarfed opened this issue May 3, 2024 · 5 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented May 3, 2024

Right now, if you opt in from the fediverse, we still don't send your posts to Bluesky until someone there follows you. This consistently confuses people; we should change it to proactively send posts, especially since fediverse people are explicitly opting in.

@snarfed
Copy link
Owner Author

snarfed commented May 6, 2024

Done! Hopefully.

@snarfed snarfed closed this as completed May 6, 2024
@qazmlp
Copy link

qazmlp commented May 6, 2024

This won't work unless a bridged user (from any network, due to the shared inbox) follows the AP user.
Most AP servers don't send posts to remote instances unless there are any followers of that specific local user there.

Related to #975 and #1018.

@snarfed
Copy link
Owner Author

snarfed commented May 6, 2024

Hah, true, I forgot the other part of this that I planned to do: have the bot user follow them back. Reopening.

@snarfed
Copy link
Owner Author

snarfed commented May 7, 2024

Done! Now, when someone on the fediverse follows @[email protected], it will follow them back, which should make sure that we start receiving their new posts immediately.

Now, for the second part of this: backfilling and making that bot user follow all existing fediverse users.

@snarfed
Copy link
Owner Author

snarfed commented May 7, 2024

Running this script now:

bot = Web.get_by_id('bsky.brid.gy')
now = util.now().isoformat()

for user in ActivityPub.query(ActivityPub.enabled_protocols == 'atproto'):
  follow_id = f'https://bsky.brid.gy/#follow-back-{user.key.id()}-{now}'
  follow = Object(id=follow_id, source_protocol='web', our_as1={
      'objectType': 'activity',
      'verb': 'follow',
      'id': follow_id,
      'actor': bot.key.id(),
      'object': user.key.id(),
  })
  try:
    user.send(follow, user.target_for(user.obj), from_user=bot)
  except BaseException as e:
    logging.info('', exc_info=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants