Extract single replyto, add "sent" flag

master
Vitaliy Filippov 2016-10-05 12:51:11 +03:00
parent 3f23809c79
commit a3e054e4b0
1 changed files with 3 additions and 1 deletions

View File

@ -431,13 +431,15 @@ Syncer.prototype.addMessage = function*(boxId, msgrow, attrs)
to: (header.to||[]).map((a) => [ a.name, a.address ]),
cc: (header.cc||[]).map((a) => [ a.name, a.address ]),
bcc: (header.bcc||[]).map((a) => [ a.name, a.address ]),
replyto: (header.replyTo||[]).map((a) => [ a.name, a.address ]),
replyto: (header.replyTo||[]).map((a) => [ a.name, a.address ])[0],
attachments: this.extractAttachments(attrs.struct),
});
msgrow.messageid = header.messageId || '';
msgrow.inreplyto = header.inReplyTo && header.inReplyTo[0] || '';
msgrow.time = header.date;
msgrow.size = attrs.size;
if (!header.headers.received || !header.headers.received.length)
msgrow.flags.push('sent');
msgrow.flags = toPgArray(msgrow.flags);
msgrow.refs = toPgArray(header.references);
for (let i in msgrow)