From 5fd64d2c9978b807fca3b94dc4524bdd499418d8 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:38:04 -0500 Subject: [PATCH] Fix image processing for onboarding story Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> --- ts/util/downloadOnboardingStory.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ts/util/downloadOnboardingStory.ts b/ts/util/downloadOnboardingStory.ts index 1f05c2faa..ae9112413 100644 --- a/ts/util/downloadOnboardingStory.ts +++ b/ts/util/downloadOnboardingStory.ts @@ -65,11 +65,11 @@ export async function downloadOnboardingStory(): Promise { log.info('downloadOnboardingStory: downloaded stories:', imageBuffers.length); const attachments: Array = await Promise.all( - imageBuffers.map(data => { + imageBuffers.map(async data => { + const local = await window.Signal.Migrations.writeNewAttachmentData(data); const attachment: AttachmentType = { contentType: IMAGE_JPEG, - data, - size: data.byteLength, + ...local, }; return window.Signal.Migrations.processNewAttachment(attachment); @@ -100,7 +100,11 @@ export async function downloadOnboardingStory(): Promise { timestamp, type: 'story', }; - return new window.Whisper.Message(partialMessage); + return window.MessageCache.__DEPRECATED$register( + partialMessage.id, + partialMessage, + 'downloadOnboardingStory' + ); } );