mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
19 lines
504 B
JavaScript
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;
|