Mailspring/packages/nylas-sync/syncback_tasks/mark-thread-as-unread.imap.js

20 lines
517 B
JavaScript
Raw Normal View History

2016-06-30 08:23:18 +08:00
const SyncbackTask = require('./syncback-task')
const TaskHelpers = require('./task-helpers')
class MarkThreadAsUnread extends SyncbackTask {
description() {
return `MarkThreadAsUnread`;
}
run(db, imap) {
const threadId = this.syncbackRequestObject().props.threadId
const eachMsg = ({message, box}) => {
return box.delFlags(message.categoryUID, 'SEEN')
}
return TaskHelpers.forEachMessageInThread({threadId, db, imap, callback: eachMsg})
}
}
module.exports = MarkThreadAsUnread;