From 37d4a74aa3324a3a31638cfa7267de56150472d5 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Thu, 27 Feb 2014 17:42:10 +0100 Subject: [PATCH] remove pgpmailer.login() --- package.json | 2 +- src/js/dao/email-dao.js | 13 ------------- test/new-unit/email-dao-test.js | 22 +--------------------- 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 04c4347..9fc27a1 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/master", "imap-client": "https://github.com/whiteout-io/imap-client/tarball/master", "mailreader": "https://github.com/whiteout-io/mailreader/tarball/master", - "pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/master", + "pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/dev/fix-smtp", "pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/master", "requirejs": "2.1.10" }, 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) {