Skip to content

Commit

Permalink
ATProto.send: temporarily disable link preview embeds
Browse files Browse the repository at this point in the history
for #1411
  • Loading branch information
snarfed committed Dec 1, 2024
1 parent 547e063 commit bc3885a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions atproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,10 @@ def _convert(cls, obj, fetch_blobs=False, from_user=None):
obj_as1 = obj.as1

# generate link preview attachment for first link in content, if any
Source.postprocess_object(
(as1.get_object(obj_as1) if obj_as1.get('objectType') == 'activity'
else obj_as1),
first_link_to_attachment=True)
# Source.postprocess_object(
# (as1.get_object(obj_as1) if obj_as1.get('objectType') == 'activity'
# else obj_as1),
# first_link_to_attachment=True)

blobs = {} # maps str URL to dict blob object
if fetch_blobs:
Expand Down
1 change: 1 addition & 0 deletions tests/test_atproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ def test_send_note_existing_repo(self, mock_create_task):

mock_create_task.assert_called() # atproto-commit

@skip
@patch.object(tasks_client, 'create_task', return_value=Task(name='my task'))
@patch('requests.get', side_effect=[
requests_response(f"""\
Expand Down
3 changes: 2 additions & 1 deletion tests/test_integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ def test_activitypub_follow_bsky_bot_bad_username_error(self, mock_get):
requests_response(PROFILE_GETRECORD), # alice profile
requests_response(DID_DOC), # alice DID
requests_response(PROFILE_GETRECORD), # alice profile
requests_response(''), # fed.brid.gy/docs for preview embed
# TODO: uncomment for link preview embeds
# requests_response(''), # fed.brid.gy/docs for preview embed
requests_response({ # getConvoForMembers
'convo': {
'id': 'convo123',
Expand Down

0 comments on commit bc3885a

Please sign in to comment.