mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-15 06:06:35 +08:00
19 lines
519 B
JavaScript
19 lines
519 B
JavaScript
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.folderImapUID, 'SEEN')
|
|
}
|
|
|
|
return TaskHelpers.forEachMessageInThread({threadId, db, imap, callback: eachMsg})
|
|
}
|
|
}
|
|
module.exports = MarkThreadAsUnread;
|