EventsDB: strip nip27 mentions from search index

This commit is contained in:
Alex Gleason 2024-06-11 18:56:11 -05:00
parent b8546ae447
commit 1151f0c28b
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
import { NDatabase, NIP50, NKinds, NostrEvent, NostrFilter, NSchema as n, NStore } from '@nostrify/nostrify';
import { Stickynotes } from '@soapbox/stickynotes';
import { Kysely } from 'kysely';
import { nip27 } from 'nostr-tools';
import { Conf } from '@/config.ts';
import { DittoTables } from '@/db/DittoTables.ts';
@ -220,7 +221,7 @@ class EventsDB implements NStore {
case 0:
return EventsDB.buildUserSearchContent(event);
case 1:
return event.content;
return nip27.replaceAll(event.content, () => '');
case 30009:
return EventsDB.buildTagsSearchContent(event.tags.filter(([t]) => t !== 'alt'));
case 30360: