Mailspring/packages/nylas-sync/syncback_tasks/unstar-thread.imap.js

19 lines
504 B
JavaScript

const SyncbackTask = require('./syncback-task')
const TaskHelpers = require('./task-helpers')
class UnstarThread extends SyncbackTask {
description() {
return `UnstarThread`;
}
run(db, imap) {
const threadId = this.syncbackRequestObject().props.threadId
const eachMsg = ({message, box}) => {
return box.delFlags(message.folderImapUID, 'FLAGGED')
}
return TaskHelpers.forEachMessageInThread({threadId, db, imap, callback: eachMsg})
}
}
module.exports = UnstarThread;