Rename createImporter to createAttachmentDataWriter

This commit is contained in:
Daniel Gasienica 2018-04-04 18:57:18 -04:00
parent 5ea1a305a6
commit 4c4443390a
4 changed files with 15 additions and 12 deletions

View file

@ -824,9 +824,9 @@ async function saveAllMessages(db, rawMessages) {
return Promise.resolve();
}
const { importMessage, upgradeMessageSchema } = Signal.Migrations;
const { writeMessageAttachments, upgradeMessageSchema } = Signal.Migrations;
const importAndUpgrade = async message =>
upgradeMessageSchema(await importMessage(message));
upgradeMessageSchema(await writeMessageAttachments(message));
const messages = await Promise.all(rawMessages.map(importAndUpgrade));

View file

@ -187,10 +187,10 @@ exports.createAttachmentLoader = (loadAttachmentData) => {
}));
};
// createImporter :: (RelativePath -> IO Unit)
// Message ->
// IO (Promise Message)
exports.createImporter = (writeExistingAttachmentData) => {
// createAttachmentDataWriter :: (RelativePath -> IO Unit)
// Message ->
// IO (Promise Message)
exports.createAttachmentDataWriter = (writeExistingAttachmentData) => {
if (!isFunction(writeExistingAttachmentData)) {
throw new TypeError('"writeExistingAttachmentData" must be a function');
}