mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-01 13:13:53 +08:00
use addtoset for marking messages as seen
This commit is contained in:
parent
e36fd11ebf
commit
1b0b0eab50
1 changed files with 4 additions and 2 deletions
6
imap.js
6
imap.js
|
@ -870,13 +870,15 @@ server.onFetch = function (path, options, session, callback) {
|
|||
return processNext();
|
||||
}
|
||||
|
||||
this.logger.debug('[%s] UPDATE FLAGS for "%s"', session.id, message.uid);
|
||||
|
||||
message.flags.unshift('\\Seen');
|
||||
|
||||
database.collection('messages').findOneAndUpdate({
|
||||
_id: message._id
|
||||
}, {
|
||||
$set: {
|
||||
flags: message.flags
|
||||
$addToSet: {
|
||||
flags: '\\Seen'
|
||||
}
|
||||
}, {}, err => {
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in a new issue