Mailspring/packages/nylas-sync/syncback_tasks/rename-folder.imap.js

17 lines
458 B
JavaScript
Raw Normal View History

2016-07-01 02:50:26 +08:00
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