mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fix: filter out invalid pubkeys
This commit is contained in:
parent
73beef72ac
commit
05a4a5a5c9
1 changed files with 4 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ import { NSchema as n } from '@nostrify/nostrify';
|
|||
import { z } from 'zod';
|
||||
|
||||
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
||||
import { fallbackAuthor } from '@/utils.ts';
|
||||
import { fallbackAuthor, isNostrId } from '@/utils.ts';
|
||||
import { findQuoteTag } from '@/utils/tags.ts';
|
||||
import { findQuoteInContent } from '@/utils/note.ts';
|
||||
import { getAmount } from '@/utils/bolt11.ts';
|
||||
|
|
@ -132,7 +132,9 @@ export function assembleEvents(
|
|||
event.quote = b.find((e) => matchFilter({ kinds: [1, 20], ids: [id] }, e));
|
||||
}
|
||||
|
||||
const pubkeys = event.tags.filter(([name]) => name === 'p').map(([_name, value]) => value);
|
||||
const pubkeys = event.tags.filter(([name]) => name === 'p')
|
||||
.map(([_name, value]) => value)
|
||||
.filter((pubkey) => isNostrId(pubkey));
|
||||
event.mentions = b.filter((e) => matchFilter({ kinds: [0], authors: pubkeys }, e));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue