mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Small improvements
This commit is contained in:
parent
5123841540
commit
c99a46a118
29 changed files with 459 additions and 26 deletions
|
|
@ -49,6 +49,11 @@ class Filter
|
|||
*/
|
||||
private $sActionValueThird;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sActionValueFourth;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
|
|
@ -89,6 +94,7 @@ class Filter
|
|||
$this->sActionValue = '';
|
||||
$this->sActionValueSecond = '';
|
||||
$this->sActionValueThird = '';
|
||||
$this->sActionValueFourth = '';
|
||||
|
||||
$this->bMarkAsRead = false;
|
||||
$this->bKeep = true;
|
||||
|
|
@ -167,6 +173,14 @@ class Filter
|
|||
return $this->sActionValueThird;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ActionValueFourth()
|
||||
{
|
||||
return $this->sActionValueFourth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
|
@ -236,6 +250,7 @@ class Filter
|
|||
$this->sActionValue = isset($aFilter['ActionValue']) ? $aFilter['ActionValue'] : '';
|
||||
$this->sActionValueSecond = isset($aFilter['ActionValueSecond']) ? $aFilter['ActionValueSecond'] : '';
|
||||
$this->sActionValueThird = isset($aFilter['ActionValueThird']) ? $aFilter['ActionValueThird'] : '';
|
||||
$this->sActionValueFourth = isset($aFilter['ActionValueFourth']) ? $aFilter['ActionValueFourth'] : '';
|
||||
|
||||
$this->bKeep = isset($aFilter['Keep']) ? '1' === (string) $aFilter['Keep'] : true;
|
||||
$this->bStop = isset($aFilter['Stop']) ? '1' === (string) $aFilter['Stop'] : true;
|
||||
|
|
@ -276,6 +291,7 @@ class Filter
|
|||
'ActionValue' => $this->ActionValue(),
|
||||
'ActionValueSecond' => $this->ActionValueSecond(),
|
||||
'ActionValueThird' => $this->ActionValueThird(),
|
||||
'ActionValueFourth' => $this->ActionValueFourth(),
|
||||
'Keep' => $this->Keep(),
|
||||
'Stop' => $this->Stop(),
|
||||
'MarkAsRead' => $this->MarkAsRead()
|
||||
|
|
|
|||
|
|
@ -350,6 +350,7 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
|||
$sValue = \trim($oFilter->ActionValue());
|
||||
$sValueSecond = \trim($oFilter->ActionValueSecond());
|
||||
$sValueThird = \trim($oFilter->ActionValueThird());
|
||||
$sValueFourth = \trim($oFilter->ActionValueFourth());
|
||||
if (0 < \strlen($sValue))
|
||||
{
|
||||
$aCapa['vacation'] = true;
|
||||
|
|
@ -367,8 +368,24 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
|||
$iDays = (int) $sValueThird;
|
||||
}
|
||||
|
||||
$aResult[] = $sTab.'vacation :days '.$iDays.' '.$sSubject.'"'.$this->quote($sValue).'";';
|
||||
$sAddresses = '';
|
||||
if (0 < \strlen($sValueFourth))
|
||||
{
|
||||
$self = $this;
|
||||
|
||||
$aAddresses = \explode(',', $sValueFourth);
|
||||
$aAddresses = \array_filter(\array_map(function ($sEmail) use ($self) {
|
||||
$sEmail = \trim($sEmail);
|
||||
return 0 < \strlen($sEmail) ? '"'.$self->quote($sEmail).'"' : '';
|
||||
}, $aAddresses), 'strlen');
|
||||
|
||||
if (0 < \count($aAddresses))
|
||||
{
|
||||
$sAddresses = ':addresses ['.\implode(', ', $aAddresses).'] ';
|
||||
}
|
||||
}
|
||||
|
||||
$aResult[] = $sTab.'vacation :days '.$iDays.' '.$sAddresses.$sSubject.'"'.$this->quote($sValue).'";';
|
||||
if ($oFilter->Stop())
|
||||
{
|
||||
$aResult[] = $sTab.'stop;';
|
||||
|
|
@ -523,7 +540,7 @@ class SieveStorage implements \RainLoop\Providers\Filters\FiltersInterface
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
private function quote($sValue)
|
||||
public function quote($sValue)
|
||||
{
|
||||
return \str_replace(array('\\', '"'), array('\\\\', '\\"'), \trim($sValue));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue