mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Only parse mentions with valid pubkeys
Fixes https://gitlab.com/soapbox-pub/ditto/-/issues/290
This commit is contained in:
parent
00953e4a0a
commit
cfa6848927
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ import { MastodonMention } from '@/entities/MastodonMention.ts';
|
|||
import { MastodonStatus } from '@/entities/MastodonStatus.ts';
|
||||
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
||||
import { Storages } from '@/storages.ts';
|
||||
import { nostrDate } from '@/utils.ts';
|
||||
import { isNostrId, nostrDate } from '@/utils.ts';
|
||||
import { getMediaLinks, parseNoteContent, stripimeta } from '@/utils/note.ts';
|
||||
import { findReplyTag } from '@/utils/tags.ts';
|
||||
import { unfurlCardCached } from '@/utils/unfurl.ts';
|
||||
|
|
@ -41,8 +41,8 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
|||
const mentionedPubkeys = [
|
||||
...new Set(
|
||||
event.tags
|
||||
.filter((tag) => tag[0] === 'p')
|
||||
.map((tag) => tag[1]),
|
||||
.filter(([name, value]) => name === 'p' && isNostrId(value))
|
||||
.map(([, value]) => value),
|
||||
),
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue