kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
4f239c92e5
commit
c2b8db8687
|
@ -230,6 +230,11 @@ class ATProto(User, Protocol):
|
|||
if user.obj and user.obj.as1:
|
||||
# create user profile
|
||||
profile = cls.convert(user.obj, fetch_blobs=True)
|
||||
profile.setdefault('labels', {'$type': 'com.atproto.label.defs#selfLabels'})
|
||||
profile['labels'].setdefault('values', []).append({
|
||||
'val' : f'bridged-from-{user.LABEL}',
|
||||
})
|
||||
|
||||
profile_json = json_dumps(dag_json.encode(profile).decode(), indent=2)
|
||||
logger.info(f'Storing ATProto app.bsky.actor.profile self: {profile_json}')
|
||||
initial_writes = [Write(
|
||||
|
|
|
@ -461,6 +461,10 @@ class ATProtoTest(TestCase):
|
|||
'ref': BLOB_CID,
|
||||
'size': 8,
|
||||
},
|
||||
'labels': {
|
||||
'$type': 'com.atproto.label.defs#selfLabels',
|
||||
'values': [{'val' : 'bridged-from-fake'}],
|
||||
},
|
||||
}, profile)
|
||||
|
||||
uri = arroba.util.at_uri(did, 'app.bsky.actor.profile', 'self')
|
||||
|
@ -564,6 +568,10 @@ class ATProtoTest(TestCase):
|
|||
'mimeType': 'image/png',
|
||||
'size': 13,
|
||||
},
|
||||
'labels': {
|
||||
'$type': 'com.atproto.label.defs#selfLabels',
|
||||
'values': [{'val' : 'bridged-from-fake'}],
|
||||
},
|
||||
}, profile)
|
||||
last_tid = arroba.util.int_to_tid(arroba.util._tid_ts_last)
|
||||
record = repo.get_record('app.bsky.feed.post', last_tid)
|
||||
|
|
|
@ -95,6 +95,10 @@ class UserTest(TestCase):
|
|||
'$type': 'app.bsky.actor.profile',
|
||||
'displayName': 'Alice',
|
||||
'description': 'hi there',
|
||||
'labels': {
|
||||
'$type': 'com.atproto.label.defs#selfLabels',
|
||||
'values': [{'val' : 'bridged-from-fake'}],
|
||||
},
|
||||
}, profile)
|
||||
|
||||
uri = at_uri(did, 'app.bsky.actor.profile', 'self')
|
||||
|
|
|
@ -430,6 +430,10 @@ class PagesTest(TestCase):
|
|||
'$type': 'app.bsky.actor.profile',
|
||||
'displayName': 'Alice',
|
||||
'description': 'hi there',
|
||||
'labels': {
|
||||
'$type': 'com.atproto.label.defs#selfLabels',
|
||||
'values': [{'val' : 'bridged-from-fake'}],
|
||||
},
|
||||
}, profile)
|
||||
|
||||
at_uri = f'at://{did}/app.bsky.actor.profile/self'
|
||||
|
|
Ładowanie…
Reference in New Issue