atproto: populate author in feeds (Atom, RSS, etc)

pull/962/head
Ryan Barrett 2024-04-12 12:04:52 -07:00
rodzic 5ec2159546
commit 117e121cd2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -234,7 +234,14 @@ def serve_feed(*, objects, format, user, title, as_snippets=False, quiet=False):
a[f] = future.result().as1
return maybe_set
future = Object.get_by_id_async(val['id'])
# TODO: extract a Protocol class method out of User.profile_id,
# then use that here instead. the catch is that we'd need to
# determine Protocol for every id, which is expensive.
id = val['id']
if id.startswith('did:'):
id = f'at://{id}/app.bsky.actor.profile/self'
future = Object.get_by_id_async(id)
future.add_done_callback(hydrate(a, field))
gets.append(future)