Fix image processing for onboarding story

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-08-13 12:38:04 -05:00 committed by GitHub
parent 126905d384
commit 5fd64d2c99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,11 +65,11 @@ export async function downloadOnboardingStory(): Promise<void> {
log.info('downloadOnboardingStory: downloaded stories:', imageBuffers.length);
const attachments: Array<AttachmentType> = 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<void> {
timestamp,
type: 'story',
};
return new window.Whisper.Message(partialMessage);
return window.MessageCache.__DEPRECATED$register(
partialMessage.id,
partialMessage,
'downloadOnboardingStory'
);
}
);