mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
EventsDB: strip nip27 mentions from search index
This commit is contained in:
parent
b8546ae447
commit
1151f0c28b
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
import { NDatabase, NIP50, NKinds, NostrEvent, NostrFilter, NSchema as n, NStore } from '@nostrify/nostrify';
|
import { NDatabase, NIP50, NKinds, NostrEvent, NostrFilter, NSchema as n, NStore } from '@nostrify/nostrify';
|
||||||
import { Stickynotes } from '@soapbox/stickynotes';
|
import { Stickynotes } from '@soapbox/stickynotes';
|
||||||
import { Kysely } from 'kysely';
|
import { Kysely } from 'kysely';
|
||||||
|
import { nip27 } from 'nostr-tools';
|
||||||
|
|
||||||
import { Conf } from '@/config.ts';
|
import { Conf } from '@/config.ts';
|
||||||
import { DittoTables } from '@/db/DittoTables.ts';
|
import { DittoTables } from '@/db/DittoTables.ts';
|
||||||
|
|
@ -220,7 +221,7 @@ class EventsDB implements NStore {
|
||||||
case 0:
|
case 0:
|
||||||
return EventsDB.buildUserSearchContent(event);
|
return EventsDB.buildUserSearchContent(event);
|
||||||
case 1:
|
case 1:
|
||||||
return event.content;
|
return nip27.replaceAll(event.content, () => '');
|
||||||
case 30009:
|
case 30009:
|
||||||
return EventsDB.buildTagsSearchContent(event.tags.filter(([t]) => t !== 'alt'));
|
return EventsDB.buildTagsSearchContent(event.tags.filter(([t]) => t !== 'alt'));
|
||||||
case 30360:
|
case 30360:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue