Merge branch 'save-lightning-address' into 'main'

Save user lud16 & website into kind 0

Closes soapbox#1662

See merge request soapbox-pub/ditto!305
This commit is contained in:
Alex Gleason 2024-05-23 19:07:05 +00:00
commit ea1c06f0c3
2 changed files with 9 additions and 0 deletions

View File

@ -227,6 +227,8 @@ const updateCredentialsSchema = z.object({
discoverable: z.boolean().optional(),
nip05: z.string().optional(),
pleroma_settings_store: z.unknown().optional(),
lud16: z.string().email().optional().catch(''),
website: z.string().url().optional().catch(''),
});
const updateCredentialsController: AppController = async (c) => {
@ -248,6 +250,8 @@ const updateCredentialsController: AppController = async (c) => {
display_name,
note,
nip05,
lud16,
website,
} = result.data;
const [avatar, header] = await Promise.all([
@ -260,6 +264,8 @@ const updateCredentialsController: AppController = async (c) => {
meta.picture = avatar?.url ?? meta.picture;
meta.banner = header?.url ?? meta.banner;
meta.nip05 = nip05 ?? meta.nip05;
meta.lud16 = lud16 ?? meta.lud16;
meta.website = website ?? meta.website;
const event = await createEvent({
kind: 0,

View File

@ -28,6 +28,7 @@ async function renderAccount(
about,
lud06,
lud16,
website,
} = n.json().pipe(n.metadata()).catch({}).parse(event.content);
const npub = nip19.npubEncode(pubkey);
@ -83,7 +84,9 @@ async function renderAccount(
},
nostr: {
pubkey,
lud16,
},
website,
};
}