Add _FORCE_SELECT_ON_EXAMINE__ property to IMAP client class

This commit is contained in:
RainLoop Team 2013-12-09 14:19:15 +04:00
parent efb9db36d2
commit 4a153a59c1
4 changed files with 21 additions and 3 deletions

View file

@ -73,6 +73,11 @@ class ImapClient extends \MailSo\Net\NetClient
*/ */
private $sLogginedUser; private $sLogginedUser;
/**
* @var bool
*/
public $__FORCE_SELECT_ON_EXAMINE__;
/** /**
* @access protected * @access protected
*/ */
@ -96,6 +101,8 @@ class ImapClient extends \MailSo\Net\NetClient
$this->bIsSelected = false; $this->bIsSelected = false;
$this->sLogginedUser = ''; $this->sLogginedUser = '';
$this->__FORCE_SELECT_ON_EXAMINE__ = false;
@\ini_set('xdebug.max_nesting_level', 500); @\ini_set('xdebug.max_nesting_level', 500);
} }
@ -854,7 +861,7 @@ class ImapClient extends \MailSo\Net\NetClient
*/ */
public function FolderExamine($sFolderName, $bReSelectSameFolders = false) public function FolderExamine($sFolderName, $bReSelectSameFolders = false)
{ {
return $this->selectOrExamineFolder($sFolderName, false, $bReSelectSameFolders); return $this->selectOrExamineFolder($sFolderName, $this->__FORCE_SELECT_ON_EXAMINE__, $bReSelectSameFolders);
} }
/** /**

View file

@ -37,6 +37,14 @@ class MailClient
return new self(); return new self();
} }
/**
* @return \MailSo\Imap\ImapClient
*/
public function ImapClient()
{
return $this->oImapClient;
}
/** /**
* @param string $sServerName * @param string $sServerName
* @param int $iPort = 143 * @param int $iPort = 143
@ -141,10 +149,10 @@ class MailClient
*/ */
private function getEnvelopeOrHeadersRequestString() private function getEnvelopeOrHeadersRequestString()
{ {
// return \MailSo\Imap\Enumerations\FetchType::ENVELOPE;
return \MailSo\Imap\Enumerations\FetchType::BODY_HEADER_PEEK; return \MailSo\Imap\Enumerations\FetchType::BODY_HEADER_PEEK;
// return \MailSo\Imap\Enumerations\FetchType::ENVELOPE;
return \MailSo\Imap\Enumerations\FetchType::BuildBodyCustomHeaderRequest(array( return \MailSo\Imap\Enumerations\FetchType::BuildBodyCustomHeaderRequest(array(
\MailSo\Mime\Enumerations\Header::RETURN_PATH, \MailSo\Mime\Enumerations\Header::RETURN_PATH,
\MailSo\Mime\Enumerations\Header::RECEIVED, \MailSo\Mime\Enumerations\Header::RECEIVED,

View file

@ -4978,6 +4978,8 @@ class Actions
{ {
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException); throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::AuthError, $oException);
} }
$this->MailClient()->ImapClient()->__FORCE_SELECT_ON_EXAMINE__ = !!$this->Config()->Get('labs', 'use_imap_force_selection');
} }
return $oAccount; return $oAccount;

View file

@ -208,6 +208,7 @@ Enables caching in the system'),
'suggestions_limit' => array(50), 'suggestions_limit' => array(50),
'determine_user_language' => array(true), 'determine_user_language' => array(true),
'use_imap_sort' => array(false), 'use_imap_sort' => array(false),
'use_imap_force_selection' => array(false),
'use_imap_list_status' => array(false), 'use_imap_list_status' => array(false),
'use_imap_list_subscribe' => array(true), 'use_imap_list_subscribe' => array(true),
'use_imap_thread' => array(true), 'use_imap_thread' => array(true),