Mailspring/packages/nylas-sync/syncback_tasks/mark-message-as-read.imap.js

19 lines
496 B
JavaScript
Raw Normal View History

const SyncbackTask = require('./syncback-task')
const TaskHelpers = require('./task-helpers')
class MarkMessageAsReadIMAP extends SyncbackTask {
description() {
return `MarkMessageAsRead`;
}
run(db, imap) {
const messageId = this.syncbackRequestObject().props.messageId
return TaskHelpers.openMessageBox({messageId, db, imap})
.then(({box, message}) => {
return box.addFlags(message.folderImapUID, 'SEEN')
})
}
}
module.exports = MarkMessageAsReadIMAP;