mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
compatMentions: remove post author and explicit text mentions
This commit is contained in:
parent
529e61be6d
commit
2f5b4557b7
1 changed files with 6 additions and 2 deletions
|
|
@ -72,7 +72,11 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||||
const bookmarkEvent = relatedEvents.find((event) => event.kind === 10003);
|
const bookmarkEvent = relatedEvents.find((event) => event.kind === 10003);
|
||||||
const zapEvent = relatedEvents.find((event) => event.kind === 9734);
|
const zapEvent = relatedEvents.find((event) => event.kind === 9734);
|
||||||
|
|
||||||
const content = buildInlineRecipients(mentions) + html;
|
const compatMentions = buildInlineRecipients(mentions.filter((m) => {
|
||||||
|
if (m.id === account.id) return false;
|
||||||
|
if (html.includes(m.url)) return false;
|
||||||
|
return true;
|
||||||
|
}));
|
||||||
|
|
||||||
const cw = event.tags.find(([name]) => name === 'content-warning');
|
const cw = event.tags.find(([name]) => name === 'content-warning');
|
||||||
const subject = event.tags.find(([name]) => name === 'subject');
|
const subject = event.tags.find(([name]) => name === 'subject');
|
||||||
|
|
@ -96,7 +100,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
||||||
id: event.id,
|
id: event.id,
|
||||||
account,
|
account,
|
||||||
card,
|
card,
|
||||||
content,
|
content: compatMentions + html,
|
||||||
created_at: nostrDate(event.created_at).toISOString(),
|
created_at: nostrDate(event.created_at).toISOString(),
|
||||||
in_reply_to_id: replyId ?? null,
|
in_reply_to_id: replyId ?? null,
|
||||||
in_reply_to_account_id: null,
|
in_reply_to_account_id: null,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue