mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29: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 { MastodonStatus } from '@/entities/MastodonStatus.ts';
|
||||||
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
||||||
import { Storages } from '@/storages.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 { getMediaLinks, parseNoteContent, stripimeta } from '@/utils/note.ts';
|
||||||
import { findReplyTag } from '@/utils/tags.ts';
|
import { findReplyTag } from '@/utils/tags.ts';
|
||||||
import { unfurlCardCached } from '@/utils/unfurl.ts';
|
import { unfurlCardCached } from '@/utils/unfurl.ts';
|
||||||
|
|
@ -41,8 +41,8 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||||
const mentionedPubkeys = [
|
const mentionedPubkeys = [
|
||||||
...new Set(
|
...new Set(
|
||||||
event.tags
|
event.tags
|
||||||
.filter((tag) => tag[0] === 'p')
|
.filter(([name, value]) => name === 'p' && isNostrId(value))
|
||||||
.map((tag) => tag[1]),
|
.map(([, value]) => value),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue