Update folderId => folderImapUID, rename messageI to uid

This commit is contained in:
Ben Gotow 2016-06-30 09:33:04 -07:00
parent b033b94091
commit a1419a65a5
2 changed files with 6 additions and 6 deletions

View file

@ -73,21 +73,21 @@ class IMAPBox {
})
}
fetchStream({messageId, options}) {
if (!messageId) {
throw new Error("IMAPConnection.fetchStream requires a message identifier.")
fetchStream({uid, options}) {
if (!uid) {
throw new Error("IMAPConnection.fetchStream requires a message uid.")
}
if (!options) {
throw new Error("IMAPConnection.fetchStream requires an options object.")
}
return new Promise((resolve, reject) => {
const f = this._imap.fetch(messageId, options);
const f = this._imap.fetch(uid, options);
f.on('message', (imapMessage) => {
imapMessage.on('body', (stream) => {
resolve(stream)
})
})
f.once('error', (error) => reject)
f.once('error', reject)
})
}

View file

@ -26,7 +26,7 @@ module.exports = (sequelize, Sequelize) => {
return message.getFolder()
.then((folder) => connection.openBox(folder.name))
.then((imapBox) => imapBox.fetchStream({
messageId: message.folderUID,
uid: message.folderImapUID,
options: {
bodies: [this.partId],
struct: true,