From 07b6d7f6f13fad3817c89bb5af6deaa54b461de1 Mon Sep 17 00:00:00 2001 From: audric Date: Tue, 10 Aug 2021 16:50:21 +1000 Subject: [PATCH] fix a bug with preview of messages not being downloaded --- ts/receiver/attachments.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts/receiver/attachments.ts b/ts/receiver/attachments.ts index 96dcf68b5..3e2e77070 100644 --- a/ts/receiver/attachments.ts +++ b/ts/receiver/attachments.ts @@ -160,6 +160,7 @@ async function processNormalAttachments( async function processPreviews(message: MessageModel, convo: ConversationModel): Promise { let addedCount = 0; const isOpenGroupV2 = convo.isOpenGroupV2(); + const openGroupV2Details = (isOpenGroupV2 && convo.toOpenGroupV2()) || undefined; const preview = await Promise.all( (message.get('preview') || []).map(async (item: any, index: any) => { @@ -173,6 +174,7 @@ async function processPreviews(message: MessageModel, convo: ConversationModel): type: 'preview', index, isOpenGroupV2, + openGroupV2Details, }); return { ...item, image }; @@ -196,6 +198,7 @@ async function processQuoteAttachments( return 0; } const isOpenGroupV2 = convo.isOpenGroupV2(); + const openGroupV2Details = (isOpenGroupV2 && convo.toOpenGroupV2()) || undefined; quote.attachments = await Promise.all( quote.attachments.map(async (item: any, index: any) => { @@ -212,6 +215,7 @@ async function processQuoteAttachments( type: 'quote', index, isOpenGroupV2, + openGroupV2Details, }); return { ...item, thumbnail };