From 15a57c7464e74e6287b1ef3056b98cb75b16e830 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 12 Dec 2013 14:47:04 +0100 Subject: [PATCH] bugfix check online status correctly --- src/js/dao/email-dao.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/js/dao/email-dao.js b/src/js/dao/email-dao.js index b1633dd..7ce5d38 100644 --- a/src/js/dao/email-dao.js +++ b/src/js/dao/email-dao.js @@ -825,7 +825,7 @@ define(function(require) { }; EmailDAO.prototype._imapMark = function(options, callback) { - if (!this._imapClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -842,7 +842,7 @@ define(function(require) { }; EmailDAO.prototype.move = function(options, callback) { - if (!this._imapClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -861,7 +861,7 @@ define(function(require) { var self = this, email = options.email; - if (!self._smtpClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -926,7 +926,7 @@ define(function(require) { }; EmailDAO.prototype.sendPlaintext = function(options, callback) { - if (!this._smtpClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -1034,7 +1034,7 @@ define(function(require) { * Cleanup by logging the user off. */ EmailDAO.prototype._imapLogout = function(callback) { - if (!this._imapClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -1053,7 +1053,7 @@ define(function(require) { * @param {Function} callback(error, uids) invoked with the uids of messages matching the search terms, or an error object if an error occurred */ EmailDAO.prototype._imapSearch = function(options, callback) { - if (!this._imapClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -1077,7 +1077,7 @@ define(function(require) { }; EmailDAO.prototype._imapDeleteMessage = function(options, callback) { - if (!this._imapClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -1098,7 +1098,7 @@ define(function(require) { EmailDAO.prototype._imapGetMessage = function(options, callback) { var self = this; - if (!this._imapClient) { + if (!this._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42 @@ -1165,7 +1165,7 @@ define(function(require) { function fetchFromServer() { var folders; - if (!self._imapClient) { + if (!self._account.online) { callback({ errMsg: 'Client is currently offline!', code: 42