mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Include fields in account.source
This commit is contained in:
parent
154056f8d6
commit
281f57d88e
1 changed files with 4 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ async function renderAccount(
|
||||||
lud06,
|
lud06,
|
||||||
lud16,
|
lud16,
|
||||||
website,
|
website,
|
||||||
fields,
|
fields: _fields,
|
||||||
} = n.json().pipe(metadataSchema).catch({}).parse(event.content);
|
} = n.json().pipe(metadataSchema).catch({}).parse(event.content);
|
||||||
|
|
||||||
const npub = nip19.npubEncode(pubkey);
|
const npub = nip19.npubEncode(pubkey);
|
||||||
|
|
@ -60,6 +60,7 @@ async function renderAccount(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { html } = parseNoteContent(about || '', []);
|
const { html } = parseNoteContent(about || '', []);
|
||||||
|
const fields = _fields?.map(([name, value]) => ({ name, value, verified_at: null })) ?? [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: pubkey,
|
id: pubkey,
|
||||||
|
|
@ -71,7 +72,7 @@ async function renderAccount(
|
||||||
discoverable: true,
|
discoverable: true,
|
||||||
display_name: name ?? '',
|
display_name: name ?? '',
|
||||||
emojis: renderEmojis(event),
|
emojis: renderEmojis(event),
|
||||||
fields: fields?.map(([name, value]) => ({ name, value, verified_at: null })) ?? [],
|
fields,
|
||||||
follow_requests_count: 0,
|
follow_requests_count: 0,
|
||||||
followers_count: event.author_stats?.followers_count ?? 0,
|
followers_count: event.author_stats?.followers_count ?? 0,
|
||||||
following_count: event.author_stats?.following_count ?? 0,
|
following_count: event.author_stats?.following_count ?? 0,
|
||||||
|
|
@ -84,7 +85,7 @@ async function renderAccount(
|
||||||
roles: [],
|
roles: [],
|
||||||
source: opts.withSource
|
source: opts.withSource
|
||||||
? {
|
? {
|
||||||
fields: [],
|
fields,
|
||||||
language: '',
|
language: '',
|
||||||
note: about || '',
|
note: about || '',
|
||||||
privacy: 'public',
|
privacy: 'public',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue