Skip to content

Commit

Permalink
Bluesky _/~ => - characters in handles: docs, another test
Browse files Browse the repository at this point in the history
for #982
  • Loading branch information
snarfed committed May 2, 2024
1 parent 4b95d49 commit 1bcd675
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions templates/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ <h3 id="from-fediverse">From the fediverse</h3>
<li class="answer">
<p>To bridge your fediverse account into Bluesky and interact with people there, search for and follow <code>@bsky.brid.gy@bsky.brid.gy</code>.</p>
<p>If your fediverse account is <code>@[user]@[instance]</code>, your bridged account will have the handle <code>[user].[instance].ap.brid.gy</code> in Bluesky. For example, <a href="https://indieweb.social/@snarfed">@snarfed@indieweb.social</a> is bridged into Bluesky as <a href="https://bsky.app/profile/snarfed.indieweb.social.ap.brid.gy">@snarfed.indieweb.social.ap.brid.gy</a>.</p>
<p>If your fediverse username has <code>_</code> (underscore) or <code>~</code> (tilde) characters, they're converted to <code>-</code> (dash) characters. For example, @a_b~c@my.social is bridged into Bluesky as @a-b-c.my.social.ap.brid.gy.
<p>Bluesky limits profile bios to 256 characters, so if yours is longer in the fediverse, it will be truncated and ellipsized.</p>
<p>Alternatively, <a href="#fediverse-follow">you can find and follow bridged Bluesky accounts</a> without bridging your own account, but they won't see your posts or interactions.<p>
</li>
Expand Down
8 changes: 4 additions & 4 deletions tests/test_atproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@ def test_create_for(self, mock_post, mock_create_task, mock_zone):
mock_zone.return_value = zone = MagicMock()
zone.resource_record_set = MagicMock()

Fake.fetchable = {'fake:user': ACTOR_AS}
user = Fake(id='fake:user')
Fake.fetchable = {'fake:us_er': ACTOR_AS}
user = Fake(id='fake:us_er')
AtpRemoteBlob(id='https://alice.com/alice.jpg',
cid=BLOB_CID.encode('base32'), size=8).put()

Expand All @@ -674,7 +674,7 @@ def test_create_for(self, mock_post, mock_create_task, mock_zone):

# check DNS record
zone.resource_record_set.assert_called_with(
name='_atproto.fake:handle:user.fa.brid.gy.', record_type='TXT',
name='_atproto.fake:handle:us-er.fa.brid.gy.', record_type='TXT',
ttl=atproto.DNS_TTL, rrdatas=[f'"did={did}"'])

# check profile record
Expand All @@ -697,7 +697,7 @@ def test_create_for(self, mock_post, mock_create_task, mock_zone):

uri = arroba.util.at_uri(did, 'app.bsky.actor.profile', 'self')
self.assertEqual([Target(uri=uri, protocol='atproto')],
Object.get_by_id(id='fake:user').copies)
Object.get_by_id(id='fake:us_er').copies)

mock_create_task.assert_called()

Expand Down

0 comments on commit 1bcd675

Please sign in to comment.