Initialize schema version upon import
This commit is contained in:
parent
cfad983d08
commit
9dcb64b53c
1 changed files with 5 additions and 3 deletions
|
@ -195,11 +195,13 @@ exports.createImporter = (writeExistingAttachmentData) => {
|
||||||
throw new TypeError('"writeExistingAttachmentData" must be a function');
|
throw new TypeError('"writeExistingAttachmentData" must be a function');
|
||||||
}
|
}
|
||||||
|
|
||||||
return async (message) => {
|
return async (rawMessage) => {
|
||||||
if (!exports.isValid(message)) {
|
if (!exports.isValid(rawMessage)) {
|
||||||
throw new TypeError('"message" is not valid');
|
throw new TypeError('"rawMessage" is not valid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const message = exports.initializeSchemaVersion(rawMessage);
|
||||||
|
|
||||||
const { attachments } = message;
|
const { attachments } = message;
|
||||||
const hasAttachments = attachments && attachments.length > 0;
|
const hasAttachments = attachments && attachments.length > 0;
|
||||||
if (!hasAttachments) {
|
if (!hasAttachments) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue