Added counters of unread messages for additional accounts (#377)

This commit is contained in:
RainLoop Team 2015-02-02 00:46:23 +04:00
parent abddb3d828
commit 79233ad83c
19 changed files with 333 additions and 93 deletions

View file

@ -869,6 +869,24 @@ class MailClient
return self::GenerateHash($sFolderName, $iCount, $iUnseenCount, $sUidNext);
}
/**
* @return int
*
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Imap\Exceptions\Exception
*/
public function InboxUnreadCount()
{
$aFolderStatus = $this->oImapClient->FolderStatus('INBOX', array(
\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN
));
$iResult = isset($aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN]) ?
(int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN] : 0;
return 0 < $iResult ? $iResult : 0;
}
/**
* @param string $sSearch
* @param bool $bDetectGmail = true