Extract single replyto, add "sent" flag
parent
3f23809c79
commit
a3e054e4b0
|
@ -431,13 +431,15 @@ Syncer.prototype.addMessage = function*(boxId, msgrow, attrs)
|
||||||
to: (header.to||[]).map((a) => [ a.name, a.address ]),
|
to: (header.to||[]).map((a) => [ a.name, a.address ]),
|
||||||
cc: (header.cc||[]).map((a) => [ a.name, a.address ]),
|
cc: (header.cc||[]).map((a) => [ a.name, a.address ]),
|
||||||
bcc: (header.bcc||[]).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),
|
attachments: this.extractAttachments(attrs.struct),
|
||||||
});
|
});
|
||||||
msgrow.messageid = header.messageId || '';
|
msgrow.messageid = header.messageId || '';
|
||||||
msgrow.inreplyto = header.inReplyTo && header.inReplyTo[0] || '';
|
msgrow.inreplyto = header.inReplyTo && header.inReplyTo[0] || '';
|
||||||
msgrow.time = header.date;
|
msgrow.time = header.date;
|
||||||
msgrow.size = attrs.size;
|
msgrow.size = attrs.size;
|
||||||
|
if (!header.headers.received || !header.headers.received.length)
|
||||||
|
msgrow.flags.push('sent');
|
||||||
msgrow.flags = toPgArray(msgrow.flags);
|
msgrow.flags = toPgArray(msgrow.flags);
|
||||||
msgrow.refs = toPgArray(header.references);
|
msgrow.refs = toPgArray(header.references);
|
||||||
for (let i in msgrow)
|
for (let i in msgrow)
|
||||||
|
|
Loading…
Reference in New Issue