renderStatus: fix duplicated attachments

This commit is contained in:
Alex Gleason 2024-05-18 16:47:47 -05:00
parent c89be75e5b
commit ce49c500ae
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 3 deletions

View File

@ -76,13 +76,11 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
const cw = event.tags.find(isCWTag);
const subject = event.tags.find((tag) => tag[0] === 'subject');
const mediaLinks = getMediaLinks(links);
const imeta: string[][][] = event.tags
.filter(([name]) => name === 'imeta')
.map(([_, ...entries]) => entries.map((entry) => entry.split(' ')));
const media = [...mediaLinks, ...imeta];
const media = imeta.length ? imeta : getMediaLinks(links);
return {
id: event.id,