mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-11-11 15:50:55 +08:00
Code refactoring
Threads sorting Big mailbox optimazations Added "labs.imap_message_list_date_filter" Added "labs.imap_message_list_count_limit_trigger" Added "labs.imap_message_list_hide_deleted_messages"
This commit is contained in:
parent
4569190691
commit
290cf38b97
9 changed files with 389 additions and 624 deletions
|
|
@ -426,6 +426,11 @@ class Utils
|
|||
*/
|
||||
public static function IsAscii($sValue)
|
||||
{
|
||||
if ('' === \trim($sValue))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return !\preg_match('/[^\x09\x10\x13\x0A\x0D\x20-\x7E]/', $sValue);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,22 @@ class Config
|
|||
public static $FixIconvByMbstring = true;
|
||||
|
||||
/**
|
||||
* @var \MailSo\Log\Logger
|
||||
* @var int
|
||||
*/
|
||||
public static $MessageListCountLimitTrigger = 0;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public static $MessageListUndeletedFilter = false;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public static $MessageListDateFilter = 0;
|
||||
|
||||
/**
|
||||
* @var \MailSo\Log\Logger|null
|
||||
*/
|
||||
public static $SystemLogger = null;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -4275,8 +4275,7 @@ class Actions
|
|||
$sFolder, $iOffset, $iLimit, $sSearch, $sUidNext,
|
||||
($this->Config()->Get('cache', 'enable', true) && $this->Config()->Get('cache', 'server_uids', false)) ? $this->Cacher() : null,
|
||||
!!$this->Config()->Get('labs', 'use_imap_sort', false),
|
||||
$bUseThreads,
|
||||
$aExpandedThreadUid,
|
||||
$bUseThreads, $aExpandedThreadUid,
|
||||
!!$this->Config()->Get('labs', 'use_imap_esearch_esort', false)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Api
|
|||
/**
|
||||
* @return \RainLoop\Actions
|
||||
*/
|
||||
private static function Actions()
|
||||
public static function Actions()
|
||||
{
|
||||
static $oActions = null;
|
||||
if (null === $oActions)
|
||||
|
|
@ -33,6 +33,14 @@ class Api
|
|||
return self::Actions()->Config();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \MailSo\Log\Logger
|
||||
*/
|
||||
public static function Logger()
|
||||
{
|
||||
return self::Actions()->Logger();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
|
@ -49,16 +57,38 @@ class Api
|
|||
return false;
|
||||
}
|
||||
|
||||
if (self::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
|
||||
\class_exists('MailSo\Capa') && \MailSo\Base\Utils::IsMbStringSupported())
|
||||
{
|
||||
\MailSo\Config::$ICONV = false;
|
||||
}
|
||||
\RainLoop\Api::SetupDefaultMailSoConfig();
|
||||
|
||||
$bOne = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function SetupDefaultMailSoConfig()
|
||||
{
|
||||
if (\class_exists('MailSo\Config'))
|
||||
{
|
||||
if (\RainLoop\Api::Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
|
||||
\MailSo\Base\Utils::IsMbStringSupported() && \MailSo\Config::$MBSTRING)
|
||||
{
|
||||
\MailSo\Config::$ICONV = false;
|
||||
}
|
||||
|
||||
\MailSo\Config::$MessageListCountLimitTrigger =
|
||||
(int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_count_limit_trigger', 0);
|
||||
|
||||
\MailSo\Config::$MessageListDateFilter =
|
||||
(int) \RainLoop\Api::Config()->Get('labs', 'imap_message_list_date_filter', 0);
|
||||
|
||||
\MailSo\Config::$MessageListUndeletedFilter =
|
||||
!!\RainLoop\Api::Config()->Get('labs', 'imap_message_list_hide_deleted_messages', true);
|
||||
|
||||
\MailSo\Config::$SystemLogger = \RainLoop\Api::Logger();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -240,6 +240,9 @@ Enables caching in the system'),
|
|||
'imap_forwarded_flag' => array('$Forwarded'),
|
||||
'imap_read_receipt_flag' => array('$ReadReceipt'),
|
||||
'imap_body_text_limit' => array(555000),
|
||||
'imap_message_list_hide_deleted_messages' => array(true),
|
||||
'imap_message_list_count_limit_trigger' => array(0),
|
||||
'imap_message_list_date_filter' => array(0),
|
||||
'smtp_show_server_errors' => array(false),
|
||||
'curl_proxy' => array(''),
|
||||
'curl_proxy_auth' => array(''),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Service
|
|||
private function __construct()
|
||||
{
|
||||
$this->oHttp = \MailSo\Base\Http::SingletonInstance();
|
||||
$this->oActions = Actions::NewInstance();
|
||||
$this->oActions = \RainLoop\Api::Actions();
|
||||
|
||||
\set_error_handler(array(&$this, 'LogPhpErrorHandler'));
|
||||
|
||||
|
|
@ -42,11 +42,7 @@ class Service
|
|||
\ini_set('display_errors', 1);
|
||||
}
|
||||
|
||||
if ($this->oActions->Config()->Get('labs', 'disable_iconv_if_mbstring_supported', false) &&
|
||||
\class_exists('MailSo\Capa') && \MailSo\Base\Utils::IsMbStringSupported())
|
||||
{
|
||||
\MailSo\Config::$ICONV = false;
|
||||
}
|
||||
\RainLoop\Api::SetupDefaultMailSoConfig();
|
||||
|
||||
$sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', ''));
|
||||
if (0 < \strlen($sServer))
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="senderParent actionHandle dragHandle">
|
||||
<span class="threadsCountParent fullThreadHandle" data-bind="visible: '' !== threadsLenResult(), css: { 'lastSelected': !lastInCollapsedThread() }">
|
||||
<span lass="threadsCount" data-bind="visible: !lastInCollapsedThreadLoading(), text: threadsLenResult"></span>
|
||||
<i class="icon-spinner animated" data-bind="visible: lastInCollapsedThreadLoading"></i>
|
||||
<span lass="threadsCount" data-bind="visible: lastInCollapsedThreadLoading()">x</span>
|
||||
</span>
|
||||
<span class="replyFlag"><i class="icon-reply"></i> </span>
|
||||
<span class="forwardFlag"><i class="icon-forward"></i> </span>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="senderParent actionHandle dragHandle">
|
||||
<span class="threadsCountParent fullThreadHandle" data-bind="visible: '' !== threadsLenResult(), css: { 'lastSelected': !lastInCollapsedThread() }">
|
||||
<span lass="threadsCount" data-bind="visible: !lastInCollapsedThreadLoading(), text: threadsLenResult"></span>
|
||||
<i class="icon-spinner animated" data-bind="visible: lastInCollapsedThreadLoading"></i>
|
||||
<span lass="threadsCount" data-bind="visible: lastInCollapsedThreadLoading()">x</span>
|
||||
</span>
|
||||
<span class="replyFlag"><i class="icon-reply"></i> </span>
|
||||
<span class="forwardFlag"><i class="icon-forward"></i> </span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue