mirror of
https://github.com/moparisthebest/mail
synced 2025-02-16 15:10:10 -05:00
integrate bugfix for syncing emails from imap
This commit is contained in:
parent
82d592f0cc
commit
e050c9854b
@ -377,10 +377,9 @@ define(function(require) {
|
|||||||
callback(null, gottenMessage);
|
callback(null, gottenMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
self._imapClient.getMessage({
|
self._imapClient.getMessagePreview({
|
||||||
path: options.folder,
|
path: options.folder,
|
||||||
uid: options.uid,
|
uid: options.uid
|
||||||
textOnly: true
|
|
||||||
}, messageReady);
|
}, messageReady);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -262,12 +262,12 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('IMAP: get message content', function() {
|
describe('IMAP: get message preview', function() {
|
||||||
it('should fail due to bad options', function(done) {
|
it('should fail due to bad options', function(done) {
|
||||||
emailDao.imapGetMessage({
|
emailDao.imapGetMessage({
|
||||||
folder: 'INBOX'
|
folder: 'INBOX'
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
expect(imapClientStub.getMessage.called).to.be.false;
|
expect(imapClientStub.getMessagePreview.called).to.be.false;
|
||||||
expect(err).to.exist;
|
expect(err).to.exist;
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@ -276,7 +276,7 @@ define(function(require) {
|
|||||||
it('should parse message body without attachement', function(done) {
|
it('should parse message body without attachement', function(done) {
|
||||||
var uid = 415;
|
var uid = 415;
|
||||||
|
|
||||||
imapClientStub.getMessage.yields(null, {
|
imapClientStub.getMessagePreview.yields(null, {
|
||||||
uid: uid,
|
uid: uid,
|
||||||
body: ''
|
body: ''
|
||||||
});
|
});
|
||||||
@ -284,7 +284,7 @@ define(function(require) {
|
|||||||
folder: 'INBOX',
|
folder: 'INBOX',
|
||||||
uid: uid
|
uid: uid
|
||||||
}, function(err, message) {
|
}, function(err, message) {
|
||||||
expect(imapClientStub.getMessage.calledOnce).to.be.true;
|
expect(imapClientStub.getMessagePreview.calledOnce).to.be.true;
|
||||||
expect(err).to.not.exist;
|
expect(err).to.not.exist;
|
||||||
expect(message.uid).to.equal(uid);
|
expect(message.uid).to.equal(uid);
|
||||||
expect(message.attachments).to.not.exist;
|
expect(message.attachments).to.not.exist;
|
||||||
@ -313,7 +313,7 @@ define(function(require) {
|
|||||||
// folder: 'INBOX',
|
// folder: 'INBOX',
|
||||||
// uid: uid
|
// uid: uid
|
||||||
// }, function(err, message) {
|
// }, function(err, message) {
|
||||||
// expect(newImapClientStub.getMessage.calledOnce).to.be.true;
|
// expect(newImapClientStub.getMessagePreview.calledOnce).to.be.true;
|
||||||
// expect(err).to.not.exist;
|
// expect(err).to.not.exist;
|
||||||
// expect(message.uid).to.equal(uid);
|
// expect(message.uid).to.equal(uid);
|
||||||
// expect(message.attachments[0].uint8Array).to.exist;
|
// expect(message.attachments[0].uint8Array).to.exist;
|
||||||
@ -330,7 +330,7 @@ define(function(require) {
|
|||||||
}, {
|
}, {
|
||||||
uid: 414,
|
uid: 414,
|
||||||
}]);
|
}]);
|
||||||
imapClientStub.getMessage.yields(null, {
|
imapClientStub.getMessagePreview.yields(null, {
|
||||||
body: 'asdf'
|
body: 'asdf'
|
||||||
});
|
});
|
||||||
devicestorageStub.removeList.yields();
|
devicestorageStub.removeList.yields();
|
||||||
@ -343,7 +343,7 @@ define(function(require) {
|
|||||||
}, function(err) {
|
}, function(err) {
|
||||||
expect(err).to.not.exist;
|
expect(err).to.not.exist;
|
||||||
expect(imapClientStub.listMessages.calledOnce).to.be.true;
|
expect(imapClientStub.listMessages.calledOnce).to.be.true;
|
||||||
expect(imapClientStub.getMessage.called).to.be.false;
|
expect(imapClientStub.getMessagePreview.called).to.be.false;
|
||||||
expect(devicestorageStub.removeList.calledOnce).to.be.true;
|
expect(devicestorageStub.removeList.calledOnce).to.be.true;
|
||||||
expect(devicestorageStub.storeList.calledOnce).to.be.true;
|
expect(devicestorageStub.storeList.calledOnce).to.be.true;
|
||||||
done();
|
done();
|
||||||
@ -358,7 +358,7 @@ define(function(require) {
|
|||||||
uid: 414,
|
uid: 414,
|
||||||
subject: app.string.subject
|
subject: app.string.subject
|
||||||
}]);
|
}]);
|
||||||
imapClientStub.getMessage.yields(null, {
|
imapClientStub.getMessagePreview.yields(null, {
|
||||||
body: 'asdf'
|
body: 'asdf'
|
||||||
});
|
});
|
||||||
devicestorageStub.removeList.yields();
|
devicestorageStub.removeList.yields();
|
||||||
@ -371,7 +371,7 @@ define(function(require) {
|
|||||||
}, function(err) {
|
}, function(err) {
|
||||||
expect(err).to.not.exist;
|
expect(err).to.not.exist;
|
||||||
expect(imapClientStub.listMessages.calledOnce).to.be.true;
|
expect(imapClientStub.listMessages.calledOnce).to.be.true;
|
||||||
expect(imapClientStub.getMessage.calledTwice).to.be.true;
|
expect(imapClientStub.getMessagePreview.calledTwice).to.be.true;
|
||||||
expect(devicestorageStub.removeList.calledOnce).to.be.true;
|
expect(devicestorageStub.removeList.calledOnce).to.be.true;
|
||||||
expect(devicestorageStub.storeList.calledOnce).to.be.true;
|
expect(devicestorageStub.storeList.calledOnce).to.be.true;
|
||||||
done();
|
done();
|
||||||
|
Loading…
Reference in New Issue
Block a user