From a6e30e550673dc0801c40e24eb39521549c31f71 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Sat, 23 Nov 2013 15:56:45 +0400 Subject: [PATCH] Small fixes --- dev/Common/Constants.js | 14 +- dev/Storages/AbstractAjaxRemote.js | 4 +- dev/Storages/WebMailData.js | 2 +- package.json | 2 +- .../libraries/RainLoop/Providers/Contacts.php | 239 +++++++++--------- 5 files changed, 137 insertions(+), 124 deletions(-) diff --git a/dev/Common/Constants.js b/dev/Common/Constants.js index 063910e6c..4ba010e9e 100644 --- a/dev/Common/Constants.js +++ b/dev/Common/Constants.js @@ -86,7 +86,19 @@ Consts.Values.SmtpDefaulSecurePort = 465; * @const * @type {number} */ -Consts.Values.iMessageBodyCacheLimit = 15; +Consts.Values.MessageBodyCacheLimit = 15; + +/** + * @const + * @type {number} + */ +Consts.Values.AjaxErrorLimit = 7; + +/** + * @const + * @type {number} + */ +Consts.Values.TokenErrorLimit = 10; /** * @const diff --git a/dev/Storages/AbstractAjaxRemote.js b/dev/Storages/AbstractAjaxRemote.js index 0f698f9a4..956b611f8 100644 --- a/dev/Storages/AbstractAjaxRemote.js +++ b/dev/Storages/AbstractAjaxRemote.js @@ -43,12 +43,12 @@ AbstractAjaxRemoteStorage.prototype.defaultResponse = function (fCallback, sRequ Globals.iTokenErrorCount++; } - if (10 < Globals.iTokenErrorCount) + if (Consts.Values.TokenErrorLimit < Globals.iTokenErrorCount) { RL.loginAndLogoutReload(true); } - if (oData.Logout || 7 < Globals.iAjaxErrorCount) + if (oData.Logout || Consts.Values.AjaxErrorLimit < Globals.iAjaxErrorCount) { if (window.__rlah_clear) { diff --git a/dev/Storages/WebMailData.js b/dev/Storages/WebMailData.js index 96c43494a..06ef63a30 100644 --- a/dev/Storages/WebMailData.js +++ b/dev/Storages/WebMailData.js @@ -357,7 +357,7 @@ WebMailDataStorage.prototype.purgeMessageBodyCache = function() var iCount = 0, oMessagesBodiesDom = null, - iEnd = Globals.iMessageBodyCacheCount - Consts.Values.iMessageBodyCacheLimit + iEnd = Globals.iMessageBodyCacheCount - Consts.Values.MessageBodyCacheLimit ; if (0 < iEnd) diff --git a/package.json b/package.json index 7180cd550..e775432ea 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.4.1", - "release": "516", + "release": "517", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "Gruntfile.js", diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Contacts.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Contacts.php index f153ec935..134bf4823 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Contacts.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Contacts.php @@ -1,120 +1,121 @@ -oDriver = null; - if ($oDriver instanceof \RainLoop\Providers\Contacts\ContactsInterface) - { - $this->oDriver = $oDriver; - } - } - - /** - * @return bool - */ - public function IsActive() - { - return $this->oDriver instanceof \RainLoop\Providers\Contacts\ContactsInterface; - } - - /** - * @return bool - */ - public function IsSupported() - { - return $this->oDriver instanceof \RainLoop\Providers\Contacts\ContactsInterface && - $this->oDriver->IsSupported(); - } - - /** - * @param \RainLoop\Account $oAccount - * @param int $iIdContact - * - * @return array - */ - public function GetContactById($oAccount, $iIdContact) - { - return $this->oDriver ? $this->oDriver->GetContactById($oAccount, $iIdContact) : null; - } - - /** - * @param \RainLoop\Account $oAccount - * @param int $iOffset = 0 - * @param int $iLimit = 20 - * @param string $sSearch = '' - * - * @return array - */ - public function GetContacts($oAccount, $iOffset = 0, $iLimit = 20, $sSearch = '') - { - return $this->oDriver ? $this->oDriver->GetContacts($oAccount, $iOffset, $iLimit, $sSearch) : array(); - } - - /** - * @param \RainLoop\Account $oAccount - * - * @return array - */ - public function GetContactsImageHashes($oAccount) - { - return $this->oDriver ? $this->oDriver->GetContactsImageHashes($oAccount) : array(); - } - - /** - * @param \RainLoop\Account $oAccount - * @param \RainLoop\Providers\Contacts\Classes\Contact $oContact - * - * @return bool - */ - public function CreateContact($oAccount, &$oContact) - { - return $this->oDriver ? $this->oDriver->CreateContact($oAccount, $oContact) : false; - } - - /** - * @param \RainLoop\Account $oAccount - * @param \RainLoop\Providers\Contacts\Classes\Contact $oContact - * - * @return bool - */ - public function UpdateContact($oAccount, &$oContact) - { - return $this->oDriver ? $this->oDriver->UpdateContact($oAccount, $oContact) : false; - } - - /** - * @param \RainLoop\Account $oAccount - * @param array $aContactIds - * - * @return bool - */ - public function DeleteContacts($oAccount, $aContactIds) - { - return $this->oDriver ? $this->oDriver->DeleteContacts($oAccount, $aContactIds) : false; - } - - /** - * @param \RainLoop\Account $oAccount - * @param array $aContactIds - * - * @return bool - */ - public function IncFrec($oAccount, $aContactIds) - { - return $this->oDriver ? $this->oDriver->IncFrec($oAccount, $aContactIds) : false; - } +oDriver = null; + if ($oDriver instanceof \RainLoop\Providers\Contacts\ContactsInterface) + { + $this->oDriver = $oDriver; + } + } + + /** + * @return bool + */ + public function IsActive() + { + return $this->oDriver instanceof \RainLoop\Providers\Contacts\ContactsInterface && + $this->oDriver->IsSupported(); + } + + /** + * @return bool + */ + public function IsSupported() + { + return $this->oDriver instanceof \RainLoop\Providers\Contacts\ContactsInterface && + $this->oDriver->IsSupported(); + } + + /** + * @param \RainLoop\Account $oAccount + * @param int $iIdContact + * + * @return array + */ + public function GetContactById($oAccount, $iIdContact) + { + return $this->oDriver ? $this->oDriver->GetContactById($oAccount, $iIdContact) : null; + } + + /** + * @param \RainLoop\Account $oAccount + * @param int $iOffset = 0 + * @param int $iLimit = 20 + * @param string $sSearch = '' + * + * @return array + */ + public function GetContacts($oAccount, $iOffset = 0, $iLimit = 20, $sSearch = '') + { + return $this->oDriver ? $this->oDriver->GetContacts($oAccount, $iOffset, $iLimit, $sSearch) : array(); + } + + /** + * @param \RainLoop\Account $oAccount + * + * @return array + */ + public function GetContactsImageHashes($oAccount) + { + return $this->oDriver ? $this->oDriver->GetContactsImageHashes($oAccount) : array(); + } + + /** + * @param \RainLoop\Account $oAccount + * @param \RainLoop\Providers\Contacts\Classes\Contact $oContact + * + * @return bool + */ + public function CreateContact($oAccount, &$oContact) + { + return $this->oDriver ? $this->oDriver->CreateContact($oAccount, $oContact) : false; + } + + /** + * @param \RainLoop\Account $oAccount + * @param \RainLoop\Providers\Contacts\Classes\Contact $oContact + * + * @return bool + */ + public function UpdateContact($oAccount, &$oContact) + { + return $this->oDriver ? $this->oDriver->UpdateContact($oAccount, $oContact) : false; + } + + /** + * @param \RainLoop\Account $oAccount + * @param array $aContactIds + * + * @return bool + */ + public function DeleteContacts($oAccount, $aContactIds) + { + return $this->oDriver ? $this->oDriver->DeleteContacts($oAccount, $aContactIds) : false; + } + + /** + * @param \RainLoop\Account $oAccount + * @param array $aContactIds + * + * @return bool + */ + public function IncFrec($oAccount, $aContactIds) + { + return $this->oDriver ? $this->oDriver->IncFrec($oAccount, $aContactIds) : false; + } } \ No newline at end of file