Added IMAP body text limit

This commit is contained in:
RainLoop Team 2014-07-18 15:32:03 +04:00
parent 037f4dc61c
commit 0fc8967a7f
5 changed files with 59 additions and 10 deletions

View file

@ -163,6 +163,11 @@ class Message
*/
private $iThreadsLen;
/**
* @var bool
*/
private $bTextPartIsTrimmed;
/**
* @var string
*/
@ -229,6 +234,8 @@ class Message
$this->iThreadsLen = 0;
$this->iParentThread = 0;
$this->bTextPartIsTrimmed = false;
$this->sPgpSignature = '';
$this->bPgpSigned = false;
$this->bPgpEncrypted = false;
@ -558,6 +565,14 @@ class Message
$this->iParentThread = $iParentThread;
}
/**
* @return boole
*/
public function TextPartIsTrimmed()
{
return $this->bTextPartIsTrimmed;
}
/**
* @param string $sFolder
* @param \MailSo\Imap\FetchResponse $oFetchResponse
@ -774,6 +789,15 @@ class Message
foreach ($aTextParts as $oPart)
{
$sText = $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::BODY.'['.$oPart->PartID().']');
if (null === $sText)
{
$sText = $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::BODY.'['.$oPart->PartID().']<0>');
if (\is_string($sText) && 0 < \strlen($sText))
{
$this->bTextPartIsTrimmed = true;
}
}
if (\is_string($sText) && 0 < \strlen($sText))
{
$sTextCharset = $oPart->Charset();