fix imap uid fetch

This commit is contained in:
Yurii
2026-02-02 11:40:08 +02:00
parent 8b6f7d4aec
commit a84c42f7a7
@@ -128,7 +128,6 @@ class DirectoryTreeStorage implements Storage
}
/**
* @todo Test.
* @inheritDoc
* @noinspection PhpRedundantCatchClauseInspection
*/
@@ -156,6 +155,13 @@ class DirectoryTreeStorage implements Storage
throw new ImapError($e->getMessage(), previous: $e);
}
// May return wrong items. Do not return one with matching id.
$output = array_filter($output, fn ($it) => $it > $id);
$output = array_values($output);
// Otherwise, it's in reverse order.
sort($output);
return $output;
}
@@ -188,6 +194,9 @@ class DirectoryTreeStorage implements Storage
throw new ImapError($e->getMessage(), previous: $e);
}
// Otherwise, it's in reverse order.
sort($output);
return $output;
}