Fix gmail imap mails count

This commit is contained in:
RainLoop Team 2014-05-27 16:54:41 +04:00
parent 57221d9a8e
commit 348cb25dbc
10 changed files with 91 additions and 30 deletions

View file

@ -87,6 +87,15 @@ html.rl-no-preview-pane {
}
}
.line-loading {
position: absolute;
left: 0;
right: 0;
z-index: 102;
height: 0px;
top: 50px;
}
.mainDelimiter {
position: absolute;
left: 0;
@ -530,6 +539,10 @@ html.ssm-state-desktop-large {
}
}
html.cssanimations.rl-anim .messageList .line-loading {
height: 5px !important;
}
.draggablePlace {
z-index: 10002;
color: #fff;

View file

@ -392,7 +392,7 @@ html.rl-no-preview-pane .messageView {
}
}
html.cssanimations.rl-anim .line-loading {
html.cssanimations.rl-anim .messageItem .line-loading {
height: 5px !important;
}

View file

@ -716,6 +716,12 @@ MailBoxMessageListViewModel.prototype.initShortcuts = function ()
}
});
// check mail
key('ctrl+r, command+r', [Enums.KeyState.FolderList, Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () {
self.reloadCommand();
return false;
});
// check all
key('ctrl+a, command+a', Enums.KeyState.MessageList, function () {
self.checkAll(!(self.checkAll() && !self.isIncompleteChecked()));

View file

@ -692,13 +692,16 @@ class MailClient
$sUidNext = isset($aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UIDNEXT])
? (string) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UIDNEXT] : '0';
if (0 === \strpos($sFolderName, '[Gmail]/'))
if ($this->IsGmail())
{
$oFolder = $this->oImapClient->FolderCurrentInformation();
if ($oFolder && null !== $oFolder->Exists)
if ($oFolder && null !== $oFolder->Exists && $oFolder->FolderName === $sFolderName)
{
$iCount = (int) $oFolder->Exists;
$iSubCount = (int) $oFolder->Exists;
if (0 < $iSubCount && $iSubCount < $iCount)
{
$iCount = $iSubCount;
}
}
}
}
@ -802,9 +805,20 @@ class MailClient
public function FolderInformation($sFolderName, $sPrevUidNext = '', $aUids = array())
{
$aFlags = array();
if (\is_array($aUids) && 0 < \count($aUids))
$bSelect = false;
if ($this->IsGmail())
{
$this->oImapClient->FolderExamine($sFolderName);
$bSelect = true;
}
if (\is_array($aUids) && 0 < \count($aUids))
{
if (!$bSelect)
{
$this->oImapClient->FolderExamine($sFolderName);
}
$aFetchResponse = $this->oImapClient->Fetch(array(
\MailSo\Imap\Enumerations\FetchType::INDEX,
@ -863,6 +877,17 @@ class MailClient
return self::GenerateHash($sFolderName, $iCount, $iUnseenCount, $sUidNext);
}
/**
* @param string $sSearch
* @param bool $bDetectGmail = true
*
* @return string
*/
public function IsGmail()
{
return 'ssl://imap.gmail.com' === \strtolower($this->oImapClient->GetConnectedHost());
}
/**
* @param string $sSearch
* @param bool $bDetectGmail = true
@ -871,9 +896,8 @@ class MailClient
*/
private function escapeSearchString($sSearch, $bDetectGmail = true)
{
return ($bDetectGmail && !\MailSo\Base\Utils::IsAscii($sSearch) &&
'ssl://imap.gmail.com' === \strtolower($this->oImapClient->GetConnectedHost()))
? '{'.\strlen($sSearch).'+}'."\r\n".$sSearch : $this->oImapClient->EscapeString($sSearch);
return ($bDetectGmail && !\MailSo\Base\Utils::IsAscii($sSearch) && $this->IsGmail())
? '{'.\strlen($sSearch).'+}'."\r\n".$sSearch : $this->oImapClient->EscapeString($sSearch);
}
/**

View file

@ -125,6 +125,7 @@
<i class="checkboxCkeckAll" data-bind="css: checkAll() ? (isIncompleteChecked() ? 'icon-checkbox-partial' : 'icon-checkbox-checked') : 'icon-checkbox-unchecked'"></i>
</div>
</div>
<div class="line-loading e-strip-animation" data-bind="visible: messageListCompleteLoadingThrottle"></div>
<div class="mainDelimiter toolbarDelimiter"></div>
<div class="b-content" data-bind="nano: true, initDom: dragOverBodyArea">
<div class="content g-scrollbox">

View file

@ -7644,6 +7644,14 @@ html.rl-no-preview-pane .messageList.message-selected {
.messageList .second-toolbar .checkboxCkeckAll {
margin: 5px 0;
}
.messageList .line-loading {
position: absolute;
left: 0;
right: 0;
z-index: 102;
height: 0px;
top: 50px;
}
.messageList .mainDelimiter {
position: absolute;
left: 0;
@ -8021,6 +8029,9 @@ html.ssm-state-desktop-large .messageList .b-content .messageListItem {
html.ssm-state-desktop-large .messageList .b-content .messageListItem .dateParent {
font-size: 13px;
}
html.cssanimations.rl-anim .messageList .line-loading {
height: 5px !important;
}
.draggablePlace {
z-index: 10002;
color: #fff;
@ -8382,7 +8393,7 @@ html.rl-no-preview-pane .messageView .b-content .buttonUnFull,
html.rl-no-preview-pane .messageView .b-content .buttonFull {
top: 70px;
}
html.cssanimations.rl-anim .line-loading {
html.cssanimations.rl-anim .messageItem .line-loading {
height: 5px !important;
}
html.rl-message-fullscreen #rl-left,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -13165,6 +13165,12 @@ MailBoxMessageListViewModel.prototype.initShortcuts = function ()
}
});
// check mail
key('ctrl+r, command+r', [Enums.KeyState.FolderList, Enums.KeyState.MessageList, Enums.KeyState.MessageView], function () {
self.reloadCommand();
return false;
});
// check all
key('ctrl+a, command+a', Enums.KeyState.MessageList, function () {
self.checkAll(!(self.checkAll() && !self.isIncompleteChecked()));

File diff suppressed because one or more lines are too long