fix: use peak so we don't mark messages as read

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-25 15:00:31 -04:00
parent 6a36e91cb4
commit 8e30b8de97
2 changed files with 5 additions and 5 deletions
@@ -57,7 +57,7 @@ final class FetchOptions
public function withHeaders(): self
{
return $this->with('BODY[HEADER]');
return $this->with('BODY.PEEK[HEADER]');
}
public function withHeader(string ...$fields): self
@@ -86,12 +86,12 @@ final class FetchOptions
public function withBodyText(): self
{
return $this->with('BODY[TEXT]');
return $this->with('BODY.PEEK[TEXT]');
}
public function withBody(): self
{
return $this->with('BODY[]');
return $this->with('BODY.PEEK[]');
}
public function withBodySection(string $section): self
@@ -102,7 +102,7 @@ final class FetchOptions
return $this;
}
return $this->with(sprintf('BODY[%s]', $section));
return $this->with(sprintf('BODY.PEEK[%s]', $section));
}
public function with(string $item): self
+1 -1
View File
@@ -68,7 +68,7 @@ final class CommandExecutor
$tag = $this->tags->next();
$this->writer->write($tag, new RequestFrame(sprintf(
'UID FETCH %s (UID BODY[%s])',
'UID FETCH %s (UID BODY.PEEK[%s])',
$target->sequenceSet()->toCommand(),
$section,
)));