mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-09 09:38:07 +08:00
Fix population of db fields in processor
This commit is contained in:
parent
91887a6e11
commit
f68948c23f
3 changed files with 4 additions and 2 deletions
|
@ -7,7 +7,7 @@ global.NylasError = NylasError;
|
|||
// 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
|
||||
// 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;
|
||||
|
||||
function runPipeline({db, accountId, message}) {
|
||||
|
|
|
@ -28,7 +28,6 @@ function processMessage({message}) {
|
|||
}
|
||||
|
||||
// extract data from the raw headers object
|
||||
message.messageId = message.headers['message-id'];
|
||||
for (const field of ['to', 'from', 'cc', 'bcc']) {
|
||||
message[field] = extractContacts(message.headers[field]);
|
||||
}
|
||||
|
|
|
@ -188,6 +188,9 @@ class FetchMessagesInCategory {
|
|||
headers: Imap.parseHeader(headers),
|
||||
}
|
||||
|
||||
values.messageId = values.headers['message-id'][0];
|
||||
values.subject = values.headers.subject[0];
|
||||
|
||||
Message.find({where: {hash}}).then((existing) => {
|
||||
if (existing) {
|
||||
Object.assign(existing, values);
|
||||
|
|
Loading…
Reference in a new issue