From a3e054e4b0e488ed2a82f105a651f106fa6146f0 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 5 Oct 2016 12:51:11 +0300 Subject: [PATCH] Extract single replyto, add "sent" flag --- Syncer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Syncer.js b/Syncer.js index a89f35c..7018f02 100644 --- a/Syncer.js +++ b/Syncer.js @@ -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)