snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy/
Creative Commons Zero v1.0 Universal
486 stars 28 forks source link

Bluesky: Bridged accounts erroneously have open DMs #1101

Closed qazmlp closed 3 weeks ago

qazmlp commented 1 month ago

I'm seeing the speech bubble button on my bridged profile: @Qazm.tiggi.es.ap.brid.gy follows me and shows the DM button.

I can also send a DM without getting an error: Me sending "Hey!" to myself on Bluesky.

This is most like due to Bluesky defaulting it to open-to-followers also for other PDSs. Since Bridgy doesn't actually support DMs, I'd like the account to show that its DMs are closed.

snarfed commented 4 weeks ago

Good point! Definitely the right idea. Maybe we could bridge DMs eventually, but not any time soon.

snarfed commented 4 weeks ago

On a related note, I wish the fediverse had this kind of explicit DM awareness! Sadly DMs there are entirely a hack, as is usual with many fediverse features. 😢

TomCasavant commented 4 weeks ago

On a related note, I wish the fediverse had this kind of explicit DM awareness! Sadly DMs there are entirely a hack, as is usual with many fediverse features. 😢

I would think they'll make them more of an official part of AP while they work on this encryption standard https://wedistribute.org/2024/05/encrypted-dms-activitypub/

snarfed commented 4 weeks ago

OK, we're now doing this for new users going forward, and I'm running this to backfill existing users:

from arroba.repo import Repo, Write
from arroba.storage import Action
from arroba.util import TombstonedRepo

chat_declaration = {
    "$type" : "chat.bsky.actor.declaration",
    "allowIncoming" : "none",
}

aps = ActivityPub.query(ActivityPub.enabled_protocols == 'atproto',
                        ActivityPub.status == None).fetch()

for i, user in enumerate(aps):
  did = user.get_copy(ATProto)
  print(i, did, user.key.id())
  try:
    repo = arroba.server.storage.load_repo(did)
  except TombstonedRepo:
    continue
  repo.apply_writes([Write(
    action=Action.CREATE, collection='chat.bsky.actor.declaration',
    rkey='self', record=chat_declaration)])