Mailspring/packages/nylas-sync/syncback_tasks/rename-folder.imap.js
2016-06-30 11:54:12 -07:00

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