mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
17 lines
458 B
JavaScript
17 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
|