mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 08:16:09 +08:00
Fix population of db fields in processor
This commit is contained in:
parent
91887a6e11
commit
f68948c23f
|
@ -7,7 +7,7 @@ global.NylasError = NylasError;
|
||||||
// List of the attributes of Message that the processor should be allowed to change.
|
// List of the attributes of Message that the processor should be allowed to change.
|
||||||
// The message may move between folders, get starred, etc. while it's being
|
// The message may move between folders, get starred, etc. while it's being
|
||||||
// processed, and it shouldn't overwrite changes to those fields.
|
// processed, and it shouldn't overwrite changes to those fields.
|
||||||
const MessageAttributes = ['body', 'processed']
|
const MessageAttributes = ['body', 'processed', 'to', 'from', 'cc', 'bcc', 'snippet']
|
||||||
const MessageProcessorVersion = 1;
|
const MessageProcessorVersion = 1;
|
||||||
|
|
||||||
function runPipeline({db, accountId, message}) {
|
function runPipeline({db, accountId, message}) {
|
||||||
|
|
|
@ -28,7 +28,6 @@ function processMessage({message}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract data from the raw headers object
|
// extract data from the raw headers object
|
||||||
message.messageId = message.headers['message-id'];
|
|
||||||
for (const field of ['to', 'from', 'cc', 'bcc']) {
|
for (const field of ['to', 'from', 'cc', 'bcc']) {
|
||||||
message[field] = extractContacts(message.headers[field]);
|
message[field] = extractContacts(message.headers[field]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,6 +188,9 @@ class FetchMessagesInCategory {
|
||||||
headers: Imap.parseHeader(headers),
|
headers: Imap.parseHeader(headers),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
values.messageId = values.headers['message-id'][0];
|
||||||
|
values.subject = values.headers.subject[0];
|
||||||
|
|
||||||
Message.find({where: {hash}}).then((existing) => {
|
Message.find({where: {hash}}).then((existing) => {
|
||||||
if (existing) {
|
if (existing) {
|
||||||
Object.assign(existing, values);
|
Object.assign(existing, values);
|
||||||
|
|
Loading…
Reference in a new issue