diff --git a/src/js/dao/email-dao.js b/src/js/dao/email-dao.js index 3e7fe63..e768ade 100644 --- a/src/js/dao/email-dao.js +++ b/src/js/dao/email-dao.js @@ -82,9 +82,6 @@ define(function(require) { } }; - // connect the pgpmailer - self._pgpmailerLogin(); - // connect to newly created imap client self._imapLogin(function(err) { if (err) { @@ -1110,16 +1107,6 @@ define(function(require) { this._devicestorage.removeList(dbType, callback); }; - - // PGP Mailer API - - /** - * Login the smtp client - */ - EmailDAO.prototype._pgpmailerLogin = function() { - this._pgpMailer.login(); - }; - // IMAP API /** diff --git a/test/new-unit/email-dao-test.js b/test/new-unit/email-dao-test.js index dfd5120..33dc3d9 100644 --- a/test/new-unit/email-dao-test.js +++ b/test/new-unit/email-dao-test.js @@ -278,12 +278,11 @@ define(function(require) { }); describe('onConnect', function() { - var imapLoginStub, imapListFoldersStub, pgpmailerLoginStub; + var imapLoginStub, imapListFoldersStub; beforeEach(function(done) { // imap login imapLoginStub = sinon.stub(dao, '_imapLogin'); - pgpmailerLoginStub = sinon.stub(dao, '_pgpmailerLogin'); imapListFoldersStub = sinon.stub(dao, '_imapListFolders'); dao.onDisconnect(null, function(err) { @@ -297,20 +296,17 @@ define(function(require) { afterEach(function() { imapLoginStub.restore(); - pgpmailerLoginStub.restore(); imapListFoldersStub.restore(); }); it('should fail due to error in imap login', function(done) { imapLoginStub.yields({}); - pgpmailerLoginStub.returns(); dao.onConnect({ imapClient: imapClientStub, pgpMailer: pgpMailerStub }, function(err) { expect(err).to.exist; - expect(pgpmailerLoginStub.calledOnce).to.be.true; expect(imapLoginStub.calledOnce).to.be.true; expect(dao._account.online).to.be.false; done(); @@ -320,7 +316,6 @@ define(function(require) { it('should work when folder already initiated', function(done) { dao._account.folders = []; imapLoginStub.yields(); - pgpmailerLoginStub.returns(); dao.onConnect({ imapClient: imapClientStub, @@ -337,7 +332,6 @@ define(function(require) { it('should work when folder not yet initiated', function(done) { var folders = []; imapLoginStub.yields(); - pgpmailerLoginStub.returns(); imapListFoldersStub.yields(null, folders); dao.onConnect({ @@ -488,20 +482,6 @@ define(function(require) { }); }); - describe('_pgpmailerLogin', function() { - it('should work', function() { - // called once in onConnect - expect(pgpMailerStub.login.calledOnce).to.be.true; - - pgpMailerStub.login.returns(); - - dao._pgpmailerLogin(); - - expect(pgpMailerStub.login.calledTwice).to.be.true; - }); - }); - - describe('_imapLogin', function() { it('should fail when disconnected', function(done) { dao.onDisconnect(null, function(err) {