mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Activate OLDER and YOUNGER of RFC 5032
This commit is contained in:
parent
ad3d8c87ec
commit
60964c9869
1 changed files with 20 additions and 6 deletions
|
|
@ -292,14 +292,26 @@ abstract class SearchCriterias
|
||||||
$bUseCache = false;
|
$bUseCache = false;
|
||||||
break;
|
break;
|
||||||
case 'OLDER_THAN':
|
case 'OLDER_THAN':
|
||||||
$aCriteriasResult[] = 'BEFORE';
|
$oDate = (new \DateTime())->sub(new \DateInterval("P{$sRawValue}"));
|
||||||
$aCriteriasResult[] = (new \DateTime())->sub(new \DateInterval("P{$sRawValue}"))->format('j-M-Y');
|
if ($oImapClient->hasCapability('WITHIN')) {
|
||||||
|
$aCriteriasResult[] = 'OLDER';
|
||||||
|
$aCriteriasResult[] = \time() - $oDate->getTimestamp();
|
||||||
|
} else {
|
||||||
|
$aCriteriasResult[] = 'BEFORE';
|
||||||
|
$aCriteriasResult[] = $oDate->format('j-M-Y');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'NEWER_THAN':
|
case 'NEWER_THAN':
|
||||||
$iTimeFilter = \max(
|
$oDate = (new \DateTime())->sub(new \DateInterval("P{$sRawValue}"));
|
||||||
$iTimeFilter,
|
if ($oImapClient->hasCapability('WITHIN')) {
|
||||||
(new \DateTime())->sub(new \DateInterval("P{$sRawValue}"))->getTimestamp()
|
$aCriteriasResult[] = 'YOUNGER';
|
||||||
);
|
$aCriteriasResult[] = \time() - $oDate->getTimestamp();
|
||||||
|
} else {
|
||||||
|
$iTimeFilter = \max(
|
||||||
|
$iTimeFilter,
|
||||||
|
(new \DateTime())->sub(new \DateInterval("P{$sRawValue}"))->getTimestamp()
|
||||||
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -397,6 +409,8 @@ abstract class SearchCriterias
|
||||||
case 'SENTSINCE':
|
case 'SENTSINCE':
|
||||||
case 'SENTBEFORE':
|
case 'SENTBEFORE':
|
||||||
case 'BEFORE':
|
case 'BEFORE':
|
||||||
|
case 'OLDER':
|
||||||
|
case 'YOUNGER':
|
||||||
if (\strlen($mValue)) {
|
if (\strlen($mValue)) {
|
||||||
$aResult[$sName] = $mValue;
|
$aResult[$sName] = $mValue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue