Fix caching for unread/flagged status

This commit is contained in:
RainLoop Team 2014-06-25 22:47:04 +04:00
parent 81e25b4235
commit a19e19d866
78 changed files with 519 additions and 514 deletions

View file

@ -223,7 +223,7 @@ WebMailAjaxRemoteStorage.prototype.messageList = function (fCallback, sFolderFul
iLimit = Utils.isUnd(iOffset) ? 20 : Utils.pInt(iLimit);
sSearch = Utils.pString(sSearch);
if ('' !== sFolderHash && ('' === sSearch || -1 === sSearch.indexOf('has:')))
if ('' !== sFolderHash && ('' === sSearch || -1 === sSearch.indexOf('is:')))
{
this.defaultRequest(fCallback, 'MessageList', {},
'' === sSearch ? Consts.Defaults.DefaultAjaxTimeout : Consts.Defaults.SearchAjaxTimeout,

View file

@ -113,7 +113,7 @@
display: inline-block;
color: #999;
text-decoration: none;
font-size: 24px;
font-size: 22px;
padding: 3px;
cursor: pointer;
@ -122,7 +122,7 @@
}
&.current .e-page-number {
font-size: 28px;
font-size: 25px;
color: #333;
border-bottom: 2px solid #000;
}

View file

@ -1085,8 +1085,9 @@ class MailClient
*
* @return string
*/
private function getImapSearchCriterias($sSearch, $iTimeZoneOffset = 0, $bAddNotDeleted = false)
private function getImapSearchCriterias($sSearch, $iTimeZoneOffset = 0, $bAddNotDeleted = false, &$bUseCache = true)
{
$bUseCache = true;
$aCriteriasResult = array();
if (0 < \strlen(\trim($sSearch)))
{
@ -1209,10 +1210,12 @@ class MailClient
if (\count($aCompareArray) > \count(\array_diff($aCompareArray, $aValue)))
{
$aCriteriasResult[] = 'FLAGGED';
$bUseCache = false;
}
else if (\count($aCompareArray2) > \count(\array_diff($aCompareArray2, $aValue)))
{
$aCriteriasResult[] = 'UNFLAGGED';
$bUseCache = false;
}
$aCompareArray = array('unread', 'unseen');
@ -1220,10 +1223,12 @@ class MailClient
if (\count($aCompareArray) > \count(\array_diff($aCompareArray, $aValue)))
{
$aCriteriasResult[] = 'UNSEEN';
$bUseCache = false;
}
else if (\count($aCompareArray2) > \count(\array_diff($aCompareArray2, $aValue)))
{
$aCriteriasResult[] = 'SEEN';
$bUseCache = false;
}
break;
@ -1654,10 +1659,10 @@ class MailClient
{
$bIndexAsUid = true;
$aIndexOrUids = null;
$bUseCache = true;
$sSearchCriterias = $this->getImapSearchCriterias($sSearch, 0, true);
if ($iMessageCacheCount < $iMessageRealCount && $oCacher && $oCacher->IsInited())
$sSearchCriterias = $this->getImapSearchCriterias($sSearch, 0, true, $bUseCache);
if ($iMessageCacheCount < $iMessageRealCount && $bUseCache && $oCacher && $oCacher->IsInited())
{
$sSerializedHash =
($bUseSortIfSupported ? 'S': 'N').'/'.

View file

@ -1717,12 +1717,11 @@ class Actions
$oAccount = $this->getAccountFromToken();
$sEmail = \trim($this->GetActionParam('Email', ''));
$sLogin = \trim($this->GetActionParam('Login', ''));
$sPassword = $this->GetActionParam('Password', '');
$this->Logger()->AddSecret($sPassword);
$sParentEmail = 0 < \strlen($oAccount->ParentEmail()) ? $oAccount->ParentEmail() : $oAccount->Email();
$sParentEmail = $oAccount->ParentEmailHelper();
$sEmail = \MailSo\Base\Utils::IdnToAscii($sEmail, true);
if ($oAccount->Email() === $sEmail || $sParentEmail === $sEmail)
@ -1730,6 +1729,7 @@ class Actions
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AccountAlreadyExists);
}
$sLogin = '';
$oNewAccount = $this->LoginProcess($sEmail, $sLogin, $sPassword);
$oNewAccount->SetParentEmail($sParentEmail);

View file

@ -6784,7 +6784,7 @@ html.no-rgba .modal {
display: inline-block;
color: #999;
text-decoration: none;
font-size: 24px;
font-size: 22px;
padding: 3px;
cursor: pointer;
}
@ -6792,7 +6792,7 @@ html.no-rgba .modal {
color: #555;
}
.e-pagenator .e-page.current .e-page-number {
font-size: 28px;
font-size: 25px;
color: #333;
border-bottom: 2px solid #000;
}

File diff suppressed because one or more lines are too long

View file

@ -17574,7 +17574,7 @@ WebMailAjaxRemoteStorage.prototype.messageList = function (fCallback, sFolderFul
iLimit = Utils.isUnd(iOffset) ? 20 : Utils.pInt(iLimit);
sSearch = Utils.pString(sSearch);
if ('' !== sFolderHash && ('' === sSearch || -1 === sSearch.indexOf('has:')))
if ('' !== sFolderHash && ('' === sSearch || -1 === sSearch.indexOf('is:')))
{
this.defaultRequest(fCallback, 'MessageList', {},
'' === sSearch ? Consts.Defaults.DefaultAjaxTimeout : Consts.Defaults.SearchAjaxTimeout,

File diff suppressed because one or more lines are too long