mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Use streams to download attachments directly to disk
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
@@ -593,10 +593,18 @@ export const processNewAttachment = async (
|
||||
isIncoming: true,
|
||||
}
|
||||
);
|
||||
const onDiskAttachment = await migrateDataToFileSystem(rotatedAttachment, {
|
||||
writeNewAttachmentData,
|
||||
logger,
|
||||
});
|
||||
|
||||
let onDiskAttachment = rotatedAttachment;
|
||||
|
||||
// If we rotated the attachment, then `data` will be the actual bytes of the attachment,
|
||||
// in memory. We want that updated attachment to go back to disk.
|
||||
if (rotatedAttachment.data) {
|
||||
onDiskAttachment = await migrateDataToFileSystem(rotatedAttachment, {
|
||||
writeNewAttachmentData,
|
||||
logger,
|
||||
});
|
||||
}
|
||||
|
||||
const finalAttachment = await captureDimensionsAndScreenshot(
|
||||
onDiskAttachment,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user