Read Receipt (#41)

This commit is contained in:
RainLoop Team 2014-01-04 04:20:07 +04:00
parent 1dc5a45564
commit b100560cd8
37 changed files with 883 additions and 461 deletions

View file

@ -213,29 +213,35 @@ class MailClient
* @param bool $bIndexIsUid
* @param string $sMessageFlag
* @param bool $bSetAction = true
* @param bool $sSkipUnsupportedFlag = false
*
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Imap\Exceptions\Exception
* @throws \MailSo\Mail\Exceptions\Exception
*/
public function MessageSetFlag($sFolderName, $aIndexRange, $bIndexIsUid, $sMessageFlag, $bSetAction = true)
public function MessageSetFlag($sFolderName, $aIndexRange, $bIndexIsUid, $sMessageFlag, $bSetAction = true, $sSkipUnsupportedFlag = false)
{
$this->oImapClient->FolderSelect($sFolderName);
$oFolderInfo = $this->oImapClient->FolderCurrentInformation();
if (!$oFolderInfo || !$oFolderInfo->IsFlagSupported($sMessageFlag))
{
throw new \MailSo\Mail\Exceptions\RuntimeException('Message flag is not supported.');
if (!$sSkipUnsupportedFlag)
{
throw new \MailSo\Mail\Exceptions\RuntimeException('Message flag is not supported.');
}
}
else
{
$sStoreAction = $bSetAction
? \MailSo\Imap\Enumerations\StoreAction::ADD_FLAGS_SILENT
: \MailSo\Imap\Enumerations\StoreAction::REMOVE_FLAGS_SILENT
;
$sStoreAction = $bSetAction
? \MailSo\Imap\Enumerations\StoreAction::ADD_FLAGS_SILENT
: \MailSo\Imap\Enumerations\StoreAction::REMOVE_FLAGS_SILENT
;
$sIndexRange = \implode(',', $aIndexRange);
$this->oImapClient->MessageStoreFlag($sIndexRange, $bIndexIsUid, array($sMessageFlag), $sStoreAction);
$sIndexRange = \implode(',', $aIndexRange);
$this->oImapClient->MessageStoreFlag($sIndexRange, $bIndexIsUid, array($sMessageFlag), $sStoreAction);
}
}
/**