mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
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:
commit
ea1c06f0c3
2 changed files with 9 additions and 0 deletions
|
|
@ -227,6 +227,8 @@ const updateCredentialsSchema = z.object({
|
||||||
discoverable: z.boolean().optional(),
|
discoverable: z.boolean().optional(),
|
||||||
nip05: z.string().optional(),
|
nip05: z.string().optional(),
|
||||||
pleroma_settings_store: z.unknown().optional(),
|
pleroma_settings_store: z.unknown().optional(),
|
||||||
|
lud16: z.string().email().optional().catch(''),
|
||||||
|
website: z.string().url().optional().catch(''),
|
||||||
});
|
});
|
||||||
|
|
||||||
const updateCredentialsController: AppController = async (c) => {
|
const updateCredentialsController: AppController = async (c) => {
|
||||||
|
|
@ -248,6 +250,8 @@ const updateCredentialsController: AppController = async (c) => {
|
||||||
display_name,
|
display_name,
|
||||||
note,
|
note,
|
||||||
nip05,
|
nip05,
|
||||||
|
lud16,
|
||||||
|
website,
|
||||||
} = result.data;
|
} = result.data;
|
||||||
|
|
||||||
const [avatar, header] = await Promise.all([
|
const [avatar, header] = await Promise.all([
|
||||||
|
|
@ -260,6 +264,8 @@ const updateCredentialsController: AppController = async (c) => {
|
||||||
meta.picture = avatar?.url ?? meta.picture;
|
meta.picture = avatar?.url ?? meta.picture;
|
||||||
meta.banner = header?.url ?? meta.banner;
|
meta.banner = header?.url ?? meta.banner;
|
||||||
meta.nip05 = nip05 ?? meta.nip05;
|
meta.nip05 = nip05 ?? meta.nip05;
|
||||||
|
meta.lud16 = lud16 ?? meta.lud16;
|
||||||
|
meta.website = website ?? meta.website;
|
||||||
|
|
||||||
const event = await createEvent({
|
const event = await createEvent({
|
||||||
kind: 0,
|
kind: 0,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ async function renderAccount(
|
||||||
about,
|
about,
|
||||||
lud06,
|
lud06,
|
||||||
lud16,
|
lud16,
|
||||||
|
website,
|
||||||
} = n.json().pipe(n.metadata()).catch({}).parse(event.content);
|
} = n.json().pipe(n.metadata()).catch({}).parse(event.content);
|
||||||
|
|
||||||
const npub = nip19.npubEncode(pubkey);
|
const npub = nip19.npubEncode(pubkey);
|
||||||
|
|
@ -83,7 +84,9 @@ async function renderAccount(
|
||||||
},
|
},
|
||||||
nostr: {
|
nostr: {
|
||||||
pubkey,
|
pubkey,
|
||||||
|
lud16,
|
||||||
},
|
},
|
||||||
|
website,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue