On message delete, ensure that all external files are deleted

This commit is contained in:
Scott Nonnenberg 2018-07-24 11:55:24 -07:00
parent e80857562a
commit 34231168a7
7 changed files with 73 additions and 79 deletions

View file

@ -110,12 +110,14 @@ function initializeMigrations({
const readAttachmentData = createReader(attachmentsPath);
const loadAttachmentData = Type.loadData(readAttachmentData);
const getAbsoluteAttachmentPath = createAbsolutePathGetter(attachmentsPath);
const deleteOnDisk = Attachments.createDeleter(attachmentsPath);
return {
attachmentsPath,
deleteAttachmentData: Type.deleteData(
Attachments.createDeleter(attachmentsPath)
),
deleteExternalMessageFiles: MessageType.deleteAllExternalFiles({
deleteAttachmentData: Type.deleteData(deleteOnDisk),
deleteOnDisk,
}),
getAbsoluteAttachmentPath,
getPlaceholderMigrations,
loadAttachmentData,