mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
feat(EventsDB): add nip05 split in buildUserSearchContent()
This commit is contained in:
parent
5addf58a10
commit
78d41bbd6d
1 changed files with 3 additions and 1 deletions
|
|
@ -240,7 +240,9 @@ class EventsDB implements NStore {
|
||||||
/** Build search content for a user. */
|
/** Build search content for a user. */
|
||||||
static buildUserSearchContent(event: NostrEvent): string {
|
static buildUserSearchContent(event: NostrEvent): string {
|
||||||
const { name, nip05 } = n.json().pipe(n.metadata()).catch({}).parse(event.content);
|
const { name, nip05 } = n.json().pipe(n.metadata()).catch({}).parse(event.content);
|
||||||
return [name, nip05].filter(Boolean).join('\n');
|
const nip05splitted = nip05 ? nip05.split(/[_@.]/) : [];
|
||||||
|
|
||||||
|
return [name, nip05, ...nip05splitted].filter(Boolean).join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Build search content from tag values. */
|
/** Build search content from tag values. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue