mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 06:47:05 +08:00
Resolve #625
This commit is contained in:
parent
538f752fbe
commit
54fc65a921
1 changed files with 18 additions and 1 deletions
|
@ -19,7 +19,7 @@ namespace MailSo\Imap;
|
||||||
abstract class SearchCriterias
|
abstract class SearchCriterias
|
||||||
{
|
{
|
||||||
const
|
const
|
||||||
RegEx = 'in|e?mail|from|to|subject|has|is|date|since|before|text|body|size|larger|bigger|smaller|maxsize|minsize|keyword';
|
RegEx = 'in|e?mail|from|to|subject|has|is|date|since|before|text|body|size|larger|bigger|smaller|maxsize|minsize|keyword|older_than|newer_than';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
https://datatracker.ietf.org/doc/html/rfc3501#section-6.4.4
|
https://datatracker.ietf.org/doc/html/rfc3501#section-6.4.4
|
||||||
|
@ -275,6 +275,23 @@ abstract class SearchCriterias
|
||||||
$aCriteriasResult[] = \gmdate('j-M-Y', $iDateStampTo);
|
$aCriteriasResult[] = \gmdate('j-M-Y', $iDateStampTo);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// https://github.com/the-djmaze/snappymail/issues/625
|
||||||
|
case 'READ':
|
||||||
|
case 'UNREAD':
|
||||||
|
$aCriteriasResult[] = \str_replace('READ', 'SEEN', $sName);
|
||||||
|
$bUseCache = false;
|
||||||
|
break;
|
||||||
|
case 'OLDER_THAN':
|
||||||
|
$aCriteriasResult[] = 'BEFORE';
|
||||||
|
$aCriteriasResult[] = (new \DateTime())->sub(new \DateInterval("P{$sRawValue}"))->format('j-M-Y');
|
||||||
|
break;
|
||||||
|
case 'NEWER_THAN':
|
||||||
|
$iTimeFilter = \max(
|
||||||
|
$iTimeFilter,
|
||||||
|
(new \DateTime())->sub(new \DateInterval("P{$sRawValue}"))->getTimestamp()
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue