fix: Mailbox::fromStatus() so omitted fields preserve known values

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-25 12:00:20 -04:00
parent a6c4fa1c23
commit 3ea76f34fb
2 changed files with 55 additions and 3 deletions
+5 -3
View File
@@ -26,13 +26,15 @@ final class Mailbox
public function fromStatus(MailboxStatusResult $status): self
{
$items = $status->items();
return new self(
$this->name,
$this->delimiter,
$this->attributes,
$status->messages() ?? $this->messages,
$status->unseen() ?? $this->unread,
$status->uidValidity() ?? $this->uidValidity,
$items['MESSAGES'] ?? $this->messages,
$items['UNSEEN'] ?? $this->unread,
$items['UIDVALIDITY'] ?? $this->uidValidity,
$this->recent,
$this->flags,
$this->readOnly,