mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 23:17:02 +03:00
Added counters of unread messages for additional accounts (#377)
This commit is contained in:
parent
abddb3d828
commit
79233ad83c
19 changed files with 333 additions and 93 deletions
|
|
@ -337,11 +337,11 @@ class Http
|
|||
}
|
||||
|
||||
/**
|
||||
* @param bool $bCheckProxy = true
|
||||
* @param bool $bCheckProxy = false
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetClientIp($bCheckProxy = true)
|
||||
public function GetClientIp($bCheckProxy = false)
|
||||
{
|
||||
$sIp = '';
|
||||
if ($bCheckProxy && null !== $this->GetServer('HTTP_CLIENT_IP', null))
|
||||
|
|
|
|||
|
|
@ -44,8 +44,10 @@ class Logger extends \MailSo\Base\Collection
|
|||
|
||||
/**
|
||||
* @access protected
|
||||
*
|
||||
* @param bool $bRegPhpErrorHandler = false
|
||||
*/
|
||||
protected function __construct()
|
||||
protected function __construct($bRegPhpErrorHandler = true)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
|
@ -55,16 +57,22 @@ class Logger extends \MailSo\Base\Collection
|
|||
$this->bShowSecter = false;
|
||||
$this->bHideErrorNotices = false;
|
||||
|
||||
\set_error_handler(array(&$this, '__phpErrorHandler'));
|
||||
if ($bRegPhpErrorHandler)
|
||||
{
|
||||
\set_error_handler(array(&$this, '__phpErrorHandler'));
|
||||
}
|
||||
|
||||
\register_shutdown_function(array(&$this, '__loggerShutDown'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bRegPhpErrorHandler = false
|
||||
*
|
||||
* @return \MailSo\Log\Logger
|
||||
*/
|
||||
public static function NewInstance()
|
||||
public static function NewInstance($bRegPhpErrorHandler = false)
|
||||
{
|
||||
return new self();
|
||||
return new self($bRegPhpErrorHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue