Properly handle avatar changes in group update messages

This commit is contained in:
Scott Nonnenberg 2018-10-24 11:31:01 -07:00
parent 7789beec64
commit 1e562c8293
2 changed files with 23 additions and 6 deletions

View file

@ -119,6 +119,7 @@ function initializeMigrations({
return {
attachmentsPath,
deleteAttachmentData: deleteOnDisk,
deleteExternalMessageFiles: MessageType.deleteAllExternalFiles({
deleteAttachmentData: Type.deleteData(deleteOnDisk),
deleteOnDisk,
@ -131,8 +132,6 @@ function initializeMigrations({
loadMessage: MessageType.createAttachmentLoader(loadAttachmentData),
Migrations0DatabaseWithAttachmentData,
Migrations1DatabaseWithoutAttachmentData,
writeNewAttachmentData: createWriterForNew(attachmentsPath),
deleteAttachmentData: deleteOnDisk,
upgradeMessageSchema: (message, options = {}) => {
const { maxVersion } = options;
@ -153,6 +152,7 @@ function initializeMigrations({
writeExistingAttachmentData: createWriterForExisting(attachmentsPath),
logger,
}),
writeNewAttachmentData: createWriterForNew(attachmentsPath),
};
}