mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
16 lines
458 B
JavaScript
16 lines
458 B
JavaScript
const SyncbackTask = require('./syncback-task')
|
|
|
|
class RenameFolderIMAP extends SyncbackTask {
|
|
description() {
|
|
return `RenameFolder`;
|
|
}
|
|
|
|
run(db, imap) {
|
|
const folderId = this.syncbackRequestObject().props.id
|
|
const newFolderName = this.syncbackRequestObject().props.displayName
|
|
return db.Folder.findById(folderId).then((folder) => {
|
|
return imap.renameBox(folder.name, newFolderName);
|
|
})
|
|
}
|
|
}
|
|
module.exports = RenameFolderIMAP
|