mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
No need to generate 1000's of ID's for MessageListByRequestIndexOrUids()
This commit is contained in:
parent
c9294619e9
commit
4a5bd9033f
1 changed files with 6 additions and 7 deletions
|
|
@ -958,13 +958,12 @@ class MailClient
|
|||
{
|
||||
$oMessageCollection->MessageResultCount = $iMessageRealCount;
|
||||
|
||||
if (1 < $iMessageRealCount)
|
||||
{
|
||||
$aRequestIndexes = \array_slice(\array_reverse(\range(1, $iMessageRealCount)), $oParams->iOffset, $oParams->iLimit);
|
||||
}
|
||||
else
|
||||
{
|
||||
$aRequestIndexes = \array_slice(array(1), $oParams->iOffset, $oParams->iLimit);
|
||||
if (1 < $iMessageRealCount) {
|
||||
$end = \max(1, $oInfo->MESSAGES - $oParams->iOffset);
|
||||
$start = \max(1, $end - $oParams->iLimit + 1);
|
||||
$aRequestIndexes = \range($start, $end);
|
||||
} else {
|
||||
$aRequestIndexes = \array_slice([1], $oParams->iOffset, 1);
|
||||
}
|
||||
|
||||
$this->MessageListByRequestIndexOrUids($oMessageCollection, new SequenceSet($aRequestIndexes, false));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue